Install in browser profile installs partially into root

Everything about using Adblock Plus on Mozilla Firefox, Thunderbird and SeaMonkey
Post Reply
Daniel

Install in browser profile installs partially into root

Post by Daniel »

Hi.

Mi Mozilla-CVS-Build (configure/make/make install) lifes in a daily new directory that ist writeable to my user.

When I install Adblock+ and click "OK" in the dialog that asks where to install it (meaning: Install in profile) most of the files are installed in my profile but not all. <MOZINST>/lib/seamonkey-1.1a/components/nsAdblock.js and <MOZINST>/lib/seamonkey-1.1a/defaults/pref/adblock.js should be in the profile, too.

Greetings,
Daniel
User avatar
mcm
Posts: 359
Joined: Sat Jun 10, 2006 2:36 am

Post by mcm »

Do you know where those files should go in your profile folder? I had no problems with Firefox recognising them in the standard location within your profile but couldn't get it to work with Mozilla so instead have put them in the standard location in the program directory where they do work.
Daniel

Post by Daniel »

mcm wrote:Do you know where those files should go in your profile folder? I had no problems with Firefox recognising them in the standard location within your profile but couldn't get it to work with Mozilla so instead have put them in the standard location in the program directory where they do work.
For components/nsAdblock.js it is easy: Add it to adblock.jar.

For defaults/preferences/adblock.js the same is true - but only for Firefox, not for Seamonkey. (http://developer.mozilla.org/en/docs/Bu ... ults_Files)

No solution here, just two ideas:

Could Adblock+ use internal default for all prefs that are missing in the environment? You should not set these defaults to the preferences but use them as if they where there.

Different idea: Add two new maps: defaultPrefs and currentPrefs. On startup (and on every prefs changed notification) do the following:

- Clear currentPrefs
- Copy defaultPrefs into currentPrefs
- For every key in currentPrefs: Replace with value of real preferences (if it exists there)
User avatar
mcm
Posts: 359
Joined: Sat Jun 10, 2006 2:36 am

Post by mcm »

Daniel wrote:For components/nsAdblock.js it is easy: Add it to adblock.jar.
That did not seem to work. Is this what you meant?
chrome/adblock.jar!/components/nsAdblock.js

The original Adblock did use internal defaults but I changed that because if I wanted to change the default value I had to search out multiple locations and I was causing errors when I missed an instance. Having values listed under about:config also means people can find and tweak them without me having to document their availability. I'm not sure how your second suggestion overcomes this.
Guest

Post by Guest »

mcm wrote:
Daniel wrote:For components/nsAdblock.js it is easy: Add it to adblock.jar.
That did not seem to work. Is this what you meant?
chrome/adblock.jar!/components/nsAdblock.js

The original Adblock did use internal defaults but I changed that because if I wanted to change the default value I had to search out multiple locations and I was causing errors when I missed an instance. Having values listed under about:config also means people can find and tweak them without me having to document their availability. I'm not sure how your second suggestion overcomes this.
My fault. Including in the adblock.jar doesn't work. Sorry for that.

My workaround (#2) doesn't help with the problem you described. But currently it seems to me that Adblock+ does not work if there are no default preferences. Having a working adblock (without a list of all defaults) would be better than having a broken Adblock+. Adblock+ doesn't work without the defaults file, does it? (This workaround was based on my assumption that adding the component to the .jar in the profile solves the other half of the problem.)

Unfortunately, my knowledge about extension development is close to zero.
Post Reply