On Mon, Feb 15, 2016 at 10:54:26AM -0600, attila wrote:
>  
> Landry Breuil <[email protected]> writes:
> 
> > On Mon, Feb 08, 2016 at 02:53:16PM -0600, attila wrote:
> >> 
> >> Landry Breuil <[email protected]> writes:
> >
> > <snip>
> >
> >> > Have you tried leaving the .xpi files compressed in their respective
> >> > dirs at runtime (eventually unzipping/patching/rezipping) as you comment
> >> > in Makefile.inc line 68 ? Iirc this should also work and is 'nicer' to
> >> > the filesystem..
> >> 
> >> I finally just grokked in fullness what you were saying here (sorry, a
> >> bit slow).  Given that I already have a start-tor-browser shell script
> >> in place to set things up we could instead switch to having .xpi files
> >> in distribution/extensions (or wherever) and unpack them when
> >> ~/.tor-browser is populated.  I'm sorry I didn't get to it before now,
> >> maybe the rest of what I've done can be critiqued and I'll make this
> >> change and test it when I get my buildbox back.
> >
> > Fwiw, in TB 45 (and, i suppose, FX 45 but ours doesnt ship default
> > extensions) the bundled xpi's stay installed as xpi, and that works just
> > fine. There should be no need to unpack them in /usr/local, nor in the
> > user profile - if i got it right, you copy those extensions to the user
> > profile ? why ?
> >
> 
> I'm sorry for not responding sooner.  The short summary of what we've
> found from testing/debugging over the last few days (on amd64 only
> sadly):
> 
> 1. extension-overrides.js only works if you drop it into the user's
>    profiledir (~/.tor-browser/profile.default/preferences).  I belive
>    this has to do with the order in which things happen at startup;
> 2. The four addons in www/tbb must be in the user's profiledir or they
>    won't be loaded (~/.tor-browser/profile.default/extensions).  It
>    just doesn't work from anywhere under /usr/local/lib/tor-browser-5.5
>    that I could find;
> 3. I was confused and not naming the .xpi files with the appid, e.g.
>    [email protected].  This is why I was convinced that
>    .xpi files weren't working - they do indeed work as you said once
>    you name them properly, but only in the user's profdir.
> 
> Attached are updated ports that rework the way the extensions are
> packaged.  They now drop .xpi files into
> /usr/local/tor-browser-5.5/distribution/extensions, as you asked.  The
> start-tor-browser script copies them as before, but just .xpi files
> not whole directory trees.  I've also ditched the idea of bothering to
> build the https-everywhere .xpi and am grabbing the official one like
> I do for noscript.  All of a sudden this is a lot easier to maintain.
> Don't know what I was thinking.

You shouldnt need to copy the xpi's to the user profile, there are ways
via tweaks to make it work.

I did the experiment with firefox 45 beta, with a profile named 'Empty'
i keep around :

sudo mkdir -p /usr/local/lib/firefox-45.0/distribution/extensions
ftp  https://www.eff.org/files/https-everywhere-5.1.0.xpi
sudo mv https-everywhere-5.1.0.xpi 
/usr/local/lib/firefox-45.0/distribution/extensions/[email protected]
firefox -P empty
-> i get the httpse banner, and the xpi was copied by firefox itself
into the profile:

8964577 -rw-r--r--  1 landry  landry  2524860 Feb 15 20:55 
/home/landry/.mozilla/firefox/3dz8yo5i.Empty/extensions/[email protected]
2443106 -rw-r--r--  1 landry  wheel   2524860 Feb 15 20:54 
/usr/local/lib/firefox-45.0/distribution/extensions/[email protected]

In thunderbird, it looks a bit different, since you can ship systemwide
addons that are not copied into the user profile (that's how lightning
works), you just have them under
/usr/local/lib/thunderbird-45.0/extensions/. Lightning is a bit special
since it has a library (.so file) so it cant stay packed as an xpi
otherwise it would fail at runtime, but other than that other addons
just work, and they're *not* copied to the user's profile, which just
gets the ones installed by the user from the UI.

I tried the same thing in firefox (ie putting
[email protected] in
/usr/local/lib/firefox-45.0/extensions/) but it failed, originally i
thought just because extensions.autoDisableScopes is at its default
(15). Tried setting it to 3 (like it's done for thunderbird via a
systemwide pref file, see
/usr/ports/mail/mozilla-thunderbird/files/all-openbsd.js) but it still
failed. Pretty sure there's a way to do it, or this has been hardened to
avoid malware tampering with firefox installs..

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/

Landry

Reply via email to