I wanted to put HTTPS-Everywhere into an RPM so its files are tracked, but installing the addon globally like this breaks the rule listing. It seems that opening the primary rule directory is hard-coded to use the user's profile.
Attached is a quick patch to check in the addon install location instead of the user profile. It should be noted that I have zero experience writing Mozilla addons, so there is a 50/50 chance of it destroying your computer.
I'll also include the RPM spec if it helps anyone test a global install more easily. (It is intended for a recent version of Fedora.)
Trac: Username: dm0
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items
...
Show closed items
Linked items
0
Link issues together to show that they're related.
Learn more.
Sorry for the delay; I just noticed the patch was removed in git. I have a problem with this: mainly that the entire AddonManager API is asynchronous. I don't see how to work this into HTTPS Everywhere without major rewrites. A new patch is attached that does not crash, but it doesn't work in Firefox 4 as it does in Firefox 3.
To keep the changes simple, I tried to have it retrieve the path asynchronously earlier in the plugin, and populate a variable with the value to be used once getRuleDir is called. However, no matter where I move that function call in the plugin, the value is only populated after getRuleDir is run (at least on my machine). I don't really know anything about writing Firefox addons (particularly for versions of Firefox that are not released), so I might be missing something obvious, but it seems that AddonManager calls are too slow to return the value in time.
I can try to make up a bigger patch later to properly use the asynchronous calls, but maybe someone else can find an easier way to handle this before then.
QFD. dm0, feel free to use the mailing list or our IRC channel to try and get help writing a fully-working version of this. The other resource that may be of use is #extdev on irc.mozilla.org.
Until we have something that's completely sane in both FF3 and FF4, I'd prefer to stick to the current behaviour but of course in the mean time distros are encouraged apply something like your patch if they'd like to build packages and are sure that their users won't be running FF4. They should probably simultaneously changed src/install.rdf to prevent FF4 installation.
I had a chance to read around the code a bit more, and it wasn't so bad to at least get it working. Although, I think this makes the assumption that the asynchronous call returns before any URL rewriting takes place. (At least the rules wouldn't be loaded until it returns.)
The updated attachment works for me in the latest Firefox stable and today's Minefield.