Landry Breuil <lan...@rhaalovely.net> writes:

> On Wed, Feb 17, 2016 at 11:51:38AM -0600, attila wrote:
>> 
>> Landry Breuil <lan...@rhaalovely.net> writes:
>> 
>> > On Mon, Feb 15, 2016 at 10:54:26AM -0600, attila wrote:
>> >> 
>> >> Landry Breuil <lan...@rhaalovely.net> writes:
>> >> <snip>
>> >
>> > You shouldnt need to copy the xpi's to the user profile, there are ways
>> > via tweaks to make it work.
>> >
>> > <snip>
>> >
>> > Of course, all this is documented in
>> > https://developer.mozilla.org/en-US/Add-ons/Installing_extensions and
>> > explained in
>> > https://mike.kaply.com/2012/02/21/understanding-add-on-scopes/
>> 
>> How right you are.  After doing some more digging I've come up with a
>> solution that ditches the start-tor-browser script and uses a mozilla
>> autoconfig file instead, along with some other tweaks to make it go as
>> per Mike Kaply and MDN.  Attached are the new ports, although still at
>> TBB 5.5 (still need to update to 5.5.2).
>> 
>> Thanks for the cluebat.  I learned a lot.
>
> Great, that looks *much* nicer now without the profile hackery that was
> done before :) I suppose with that, the xpis are directly opened from
> the systemwide install, and not copied to the running profile anymore ?
>
> Have you tried various settings for the scopes ? (honestly, for
> thunderbird it was a try-and-see, and i ended up with 3, i see you use
> 5, just wondering about the reasoning)

I went with 5 because it seemed like 4|1 was correct based on the
description of the flag bits at
https://developer.mozilla.org/en-US/Add-ons/Installing_extensions:

    Value       Install scope
    1           The current users's profile.
    2           All profiles of the logged-in user.
    4           Installed and owned by Firefox.
    8           Installed for all users of the computer.
    15          The combination of all scopes.

We want the extensions that are part of the bundle to be found and we
also want the user to be able to install their own extensions (thus my
thinking 4|1).  I wanted to give a better response than *shrug* to
your question so I've now tried with enabledScopes set to 1, 2, 3, 4, 5,
8, 15 and 0 and in all cases in my testing the same thing happened:
tor-browser copies the .xpi files from
/usr/local/lib/tor-browser-5.5/distribution/extensions to the user's
profile during initialization and seems to run them from there.  In
one case (enabledScopes = 2) an empty extensions/ subdir was created
under ~/.tor-browser (DefProfRt) as well.  When autoDisableScopes is
set to 15 it makes no difference, which surprised me a lot.  I
verified in each case in about:config that the values of
extensions.enabledScopes and .autoDisableScopes were what I thought
they were.  They default to 1 and 0 in tor-browser, respectively.

I could've sworn those .xpi files were not being recognized in
distribution/extensions before I went down this path, but somehow now
they are, so I must've be wrong.  It isn't the presence of the
autoconfig file, either, since I tried turning that off and the
extensions were still loaded, just misconfigured.  When I get time
I'll figure out why enabledScopes doesn't (seem to) matter by looking
at all their patches to ESR... there must be something in there.

> Lots of things are 'hardcoded' in tor-browser.cfg, where are those
> values coming from, can you maybe document them ?

Most of that file is from extension-overrides.js in the TBB, slightly
munged.  Its purpose is to tweak prefs in the extensions and to
configure default bridges for pluggable transports, the latter of
which we don't support at all yet.  All of those values come verbatim
from upstream - they are the way the Tor project has decided
e.g. noscript should be configured in TBB.

I didn't mean to leave that bit I added at the top and have since
moved it to the bottom so that file is more textually similar to
upstream, but I have to mung it a little because hash-style comments
don't work in an autoconfig file.  Keeping tor-browser.cfg in sync
with extension-overrides.js as it ships in the official bundle is
something I will automate as soon as I can.

> I noticed that www/tbb/tbb/Makefile still mentions gxmessage for
> start-tor-browser, i suppose that's not needed anymore ?

Right.  Gone.

> One thing more packaging-related: i see that tor-browser RUN_DEPENDS on
> the extensions, but 'conceptually' it'd be better the other way for two
> reasons:
> - the extensions are useless without tor-browser installed
> - tor-browser *could* run without the extensions (but wouldnt provide
>   the expected user-experience, agreed)
>
> Making it the other way could also allow you to get rid of the
> directories from each extension PLIST, which would only contain the xpi
> file, since the directory hierarchy is in tor-browser PLIST.

I've flip-flopped on this many times now during the course of this.  I
was trying to convince myself that the current way is better than the
reverse but you've convinced me to stop trying and go back to the
extensions depending on tor-browser, which is how I had it before.

>
> I dont remember it being discussed before, but was a meta/tbb port
> considered, run-depending on the 4 extensions & tor-browser 'main'
> package ? Users would just have to install this one to get the whole
> thing.

In fact I did have a meta/tbb port that was exactly what you said and
got rid of it about a month ago when I decided to reverse the
run-deps.  I have resurrected it and attached it as well.

> I'll try to find some time to look better into all this.

That would be excellent.

One quick question: should the the four extensions say

    PKG_ARCH=*

There's no reason not to, is there?

> Landry

Updated ports attached, which include a fixed tor-browser.desktop
file.  The desktop icon fu should work, but I think my laptop will
explode if I install gnome on it so if someone who runs a "real"
desktop environment could test that the icon works that would be
swell.  Ports are still at 5.5 (ENOTIME).  We've recooked the packages
against the latest snap and are building them for i386 now as well:

  http://mirrors.nycbug.org/pub/snapshots/packages/amd64/README-55-amd64.txt
  http://mirrors.nycbug.org/pub/snapshots/packages/i386/README-55-i386.txt

For testing purposes only.  We'll say something about 5.5.2 soon.

Pax, -A
--
http://haqistan.net/~attila | att...@stalphonsos.com | 0xE6CC1EDB

Attachment: tbb-resub4.tgz
Description: updated tor browser ports

Reply via email to