Page 1 of 1

[Resolved] Why is user.js ignored when setting whitelist?

Posted: Sat Dec 21, 2013 6:11 pm
by amoe
Hi there,

I want to do something rather unusual -- maintain my whitelist as a text-based configuration in user.js.
I'm fine with whitelist changes I make in the browser being lost. I want to store the whitelist in this format so that I can use puppet to deploy it on various machines.

Anyway, I thought that if I set "capability.policy.maonoscript.sites" in user.js, like so (just using google.com for the whitelisted domain example, plus the standard domains):

Code: Select all

user_pref("capability.policy.maonoscript.sites", "google.com about: about:addons about:blank about:blocked about:certerror about:config about:crashes about:home about:memory about:neterror about:plugins about:privatebrowsing about:sessionrestore about:support blob: chrome: resource:");
Then that whitelist should take effect. However, whatever I specify in user.js is just disregarded. It doesn't override prefs.js like user.js is supposed to. Why would this be? Any other way I can maintain my whitelist as a text file?

Cheers!

Re: Why is user.js ignored when setting whitelist?

Posted: Sat Dec 21, 2013 7:55 pm
by barbaz
WFM... but I'm on SeaMonkey not Iceweasel.

When it doesn't work, are you getting the default whitelist or your user-defined whitelist from prefs.js? Does it work if you add http://google.com and https://google.com in alpbabetical order (after chrome:)?

Re: Why is user.js ignored when setting whitelist?

Posted: Fri Dec 27, 2013 11:18 pm
by amoe
Thanks so much barbaz. I was able to confirm that this does in fact work with my Iceweasel / Noscript configuration. I was attempting to do other complicated things in other parts of user.js that simply caused FF to discard the entire file. I wasn't aware that user.js is not run by the Javascript parser. Once I trimmed it down to simple user_pref() calls it started working fine.