Page 1 of 1

Whitelist GitHub

Posted: Wed Nov 26, 2014 5:32 am
by svnpenn
I would like to Whitelist github.com

I created a user.js for Firefox that has

Code: Select all

user_pref('capability.policy.maonoscript.sites', 'github.com');
However for some reason it only works if I use

Code: Select all

user_pref('capability.policy.maonoscript.sites', 'github.com https://github.com');
Why must I use both forms? It is my understanding that the github.com form
covers everything.

Re: Whitelist GitHub

Posted: Wed Nov 26, 2014 5:48 am
by barbaz
Because internally, NoScript is designed to use CAPS-style parsing for the whitelist, not an AddressMatcher. Using only "github.com" would work if you add it through the GUI, where the https entry you discovered is needed would be automatically generated. If you're whitelisting a whole second-level domain manually in the pref you need to do it like this

Code: Select all

user_pref('capability.policy.maonoscript.sites', 'github.com http://github.com https://github.com');
Also you might want to make sure the entries are sorted as follows:
1) domain literals, alphabetically (github.com othersi.te)
2) anything that has a scheme, alphabetically (about: blob: chrome: file:// http://github.com http://othersi.te https://github.com https://othersi.te resource:)

(FYI, this weirdness only applies to 2nd-level domains AFAICT. If you wanted to only whitelisted a subdomain of a 2nd-level domain, it *is* enough just to put the domain and not the http:// & https:// entries.)

If you do all of that your user_pref will look just like if it were automatically generated and therefore it will behave as if you built your whitelist through the GUI.

Hope that helps