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

Ask for help about NoScript, no registration needed to post
amoe
Posts: 2
Joined: Sat Dec 21, 2013 5:57 pm

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

Post 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!
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20131215 Firefox/24.0 Iceweasel/24.2.0
barbaz
Senior Member
Posts: 11163
Joined: Sat Aug 03, 2013 5:45 pm

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

Post 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:)?
*Always* check the changelogs BEFORE updating that important software!
Mozilla/5.0 (X11; Linux i686; rv:26.0) Gecko/20100101 Firefox/26.0 SeaMonkey/2.23
amoe
Posts: 2
Joined: Sat Dec 21, 2013 5:57 pm

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

Post 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.
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20131215 Firefox/24.0 Iceweasel/24.2.0
Post Reply