Added two library files (one, lib/restricted.js, missing from rc8 tag) and version bump.
This commit is contained in:
parent
103324e5d2
commit
7dfa2e640b
|
@ -0,0 +1,30 @@
|
|||
class ContentMetaData {
|
||||
constructor(request, defaultCharset = "utf-8") {
|
||||
this.defaultCharset = defaultCharset;
|
||||
let {responseHeaders} = request;
|
||||
for (let h of responseHeaders) {
|
||||
if (/^\s*Content-(Type|Disposition)\s*$/i.test(h.name)) {
|
||||
this[h.name.split("-")[1].trim().toLowerCase()] = h.value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
get charset() {
|
||||
let charset = this.defaultCharset;
|
||||
if (this.type) {
|
||||
let m = this.type.match(/;\s*charset\s*=\s*(\S+)/);
|
||||
if (m) {
|
||||
charset = m[1];
|
||||
}
|
||||
}
|
||||
Object.defineProperty(this, "charset", { value: charset, writable: false, configurable: true })
|
||||
}
|
||||
|
||||
createDecoder() {
|
||||
try {
|
||||
return new TextDecoder(charset);
|
||||
} catch (e) {
|
||||
return new TextDecoder(this.defaultCharset);
|
||||
}
|
||||
}
|
||||
};
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -8,7 +8,7 @@
|
|||
"strict_min_version": "59.0"
|
||||
}
|
||||
},
|
||||
"version": "10.1.8.3rc8",
|
||||
"version": "10.1.8.3rc9",
|
||||
"description": "__MSG_Description__",
|
||||
|
||||
"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'none'",
|
||||
|
@ -39,6 +39,7 @@
|
|||
"lib/include.js",
|
||||
"lib/punycode.js",
|
||||
"lib/tld.js",
|
||||
"lib/ContentMetaData.js",
|
||||
"common/Policy.js",
|
||||
"common/locale.js",
|
||||
"common/Entities.js",
|
||||
|
|
Loading…
Reference in New Issue