summaryrefslogtreecommitdiff
path: root/src/lib/restricted.js
diff options
context:
space:
mode:
authorhackademix2018-07-09 19:23:03 +0200
committerhackademix2018-07-09 19:29:23 +0200
commit7dfa2e640bcd5934831920139338b6bb656bcdc5 (patch)
treeedf9555fce31ec8f8463d19b998196f4efeaa4c9 /src/lib/restricted.js
parent103324e5d2ea5ac2ea589a44b822a997ff503be3 (diff)
downloadnoscript-7dfa2e640bcd5934831920139338b6bb656bcdc5.tar.gz
noscript-7dfa2e640bcd5934831920139338b6bb656bcdc5.tar.xz
noscript-7dfa2e640bcd5934831920139338b6bb656bcdc5.zip
Added two library files (one, lib/restricted.js, missing from rc8 tag) and version bump.
Diffstat (limited to 'src/lib/restricted.js')
-rw-r--r--src/lib/restricted.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/lib/restricted.js b/src/lib/restricted.js
new file mode 100644
index 0000000..ae85ba8
--- /dev/null
+++ b/src/lib/restricted.js
@@ -0,0 +1,29 @@
+{
+ // see https://bugzilla.mozilla.org/show_bug.cgi?id=1415644
+ let domains = [
+ "accounts-static.cdn.mozilla.net",
+ "accounts.firefox.com",
+ "addons.cdn.mozilla.net",
+ "addons.mozilla.org",
+ "api.accounts.firefox.com",
+ "content.cdn.mozilla.net",
+ "content.cdn.mozilla.net",
+ "discovery.addons.mozilla.org",
+ "input.mozilla.org",
+ "install.mozilla.org",
+ "oauth.accounts.firefox.com",
+ "profile.accounts.firefox.com",
+ "support.mozilla.org",
+ "sync.services.mozilla.com",
+ "testpilot.firefox.com",
+ ];
+
+ function isRestrictedURL(u) {
+ try {
+ if (typeof u === "string") u = new URL(u);
+ return u.protocol === "https:" && domains.includes(u.hostname);
+ } catch (e) {
+ return false;
+ }
+ }
+}