diff --git a/browser/components/nsBrowserGlue.js b/browser/components/nsBrowserGlue.js
index a9d95bb0cf..af8a33570a 100644
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -922,7 +922,9 @@ BrowserGlue.prototype = {
AutoCompletePopup.init();
DateTimePickerHelper.init();
- this._firstWindowLoaded();
+ if (typeof this._firstWindowLoaded == "function") {
+ this._firstWindowLoaded();
+ }
},
/**
diff --git a/browser/components/webextensions/schemas/context_menus.json b/browser/components/webextensions/schemas/context_menus.json
index b31af51f3f..7f9702fa55 100644
--- a/browser/components/webextensions/schemas/context_menus.json
+++ b/browser/components/webextensions/schemas/context_menus.json
@@ -11,7 +11,8 @@
"choices": [{
"type": "string",
"enum": [
- "contextMenus"
+ "contextMenus",
+ "menus"
]
}]
}
@@ -20,7 +21,7 @@
{
"namespace": "contextMenus",
"description": "Use the browser.contextMenus API to add items to the browser's context menu. You can choose what types of objects your context menu additions apply to, such as images, hyperlinks, and pages.",
- "permissions": ["contextMenus"],
+ "permissions": ["contextMenus", "menus"],
"properties": {
"ACTION_MENU_TOP_LEVEL_LIMIT": {
"value": 6,
diff --git a/js/src/vm/StructuredClone.cpp b/js/src/vm/StructuredClone.cpp
index 50e6162923..6a3ca514b9 100644
--- a/js/src/vm/StructuredClone.cpp
+++ b/js/src/vm/StructuredClone.cpp
@@ -2323,11 +2323,16 @@ JSStructuredCloneReader::readHeader()
return false;
}
+ // Some older IndexedDB writers stored the compatibility marker in the
+ // header. Read those records as durable cross-process data.
+ if (storedScope == JS::StructuredCloneScope::DifferentProcessForIndexedDB) {
+ storedScope = JS::StructuredCloneScope::DifferentProcess;
+ }
+
if (allowedScope == JS::StructuredCloneScope::DifferentProcessForIndexedDB) {
// Bug 1434308 and bug 1458320 - the scopes stored in old IndexedDB
// clones are incorrect. Treat them as if they were DifferentProcess.
allowedScope = JS::StructuredCloneScope::DifferentProcess;
- return true;
}
if (storedScope < allowedScope) {
diff --git a/toolkit/components/webextensions/ext-dns.js b/toolkit/components/webextensions/ext-dns.js
new file mode 100644
index 0000000000..b131d0b6e5
--- /dev/null
+++ b/toolkit/components/webextensions/ext-dns.js
@@ -0,0 +1,41 @@
+"use strict";
+
+var {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
+Cu.import("resource://gre/modules/Services.jsm");
+Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+
+function dnsResolve(hostname, flags = []) {
+ let mask = 0;
+ for (let flag of flags) {
+ switch (flag) {
+ case "bypass_cache": mask |= Ci.nsIDNSService.RESOLVE_BYPASS_CACHE; break;
+ case "canonical_name": mask |= Ci.nsIDNSService.RESOLVE_CANONICAL_NAME; break;
+ case "disable_ipv4": mask |= Ci.nsIDNSService.RESOLVE_DISABLE_IPV4; break;
+ case "disable_ipv6": mask |= Ci.nsIDNSService.RESOLVE_DISABLE_IPV6; break;
+ case "offline": mask |= Ci.nsIDNSService.RESOLVE_OFFLINE; break;
+ case "priority_low": mask |= Ci.nsIDNSService.RESOLVE_PRIORITY_LOW; break;
+ case "priority_medium": mask |= Ci.nsIDNSService.RESOLVE_PRIORITY_MEDIUM; break;
+ case "allow_name_collisions": mask |= Ci.nsIDNSService.RESOLVE_ALLOW_NAME_COLLISION; break;
+ }
+ }
+ let dns = Cc["@mozilla.org/network/dns-service;1"].getService(Ci.nsIDNSService);
+ return new Promise((resolve, reject) => {
+ let listener = {
+ onLookupComplete(request, record, status) {
+ if (Components.isSuccessCode(status)) {
+ let addresses = [];
+ try { record.rewind(); while (record.hasMore()) addresses.push(record.getNextAddrAsString()); } catch (e) {}
+ resolve({addresses, canonicalName: record.canonicalName || undefined, isTRR: false});
+ } else {
+ reject(Components.Exception("DNS resolution failed", status));
+ }
+ },
+ QueryInterface: XPCOMUtils.generateQI([Ci.nsIDNSListener]),
+ };
+ dns.asyncResolve(hostname, mask, listener, Services.tm.mainThread);
+ });
+}
+
+extensions.registerSchemaAPI("dns", "addon_parent", () => ({
+ dns: { resolve: dnsResolve },
+}));
diff --git a/toolkit/components/webextensions/extensions-toolkit.manifest b/toolkit/components/webextensions/extensions-toolkit.manifest
index 4ec65a9844..5a5151aea6 100644
--- a/toolkit/components/webextensions/extensions-toolkit.manifest
+++ b/toolkit/components/webextensions/extensions-toolkit.manifest
@@ -8,6 +8,7 @@ category webextension-scripts notifications chrome://extensions/content/ext-noti
category webextension-scripts i18n chrome://extensions/content/ext-i18n.js
category webextension-scripts idle chrome://extensions/content/ext-idle.js
category webextension-scripts webRequest chrome://extensions/content/ext-webRequest.js
+category webextension-scripts dns chrome://extensions/content/ext-dns.js
category webextension-scripts webNavigation chrome://extensions/content/ext-webNavigation.js
category webextension-scripts runtime chrome://extensions/content/ext-runtime.js
category webextension-scripts extension chrome://extensions/content/ext-extension.js
@@ -47,3 +48,4 @@ category webextension-schemas test chrome://extensions/content/schemas/test.json
category webextension-schemas top_sites chrome://extensions/content/schemas/top_sites.json
category webextension-schemas web_navigation chrome://extensions/content/schemas/web_navigation.json
category webextension-schemas web_request chrome://extensions/content/schemas/web_request.json
+category webextension-schemas dns chrome://extensions/content/schemas/dns.json
diff --git a/toolkit/components/webextensions/schemas/dns.json b/toolkit/components/webextensions/schemas/dns.json
new file mode 100644
index 0000000000..7484656e59
--- /dev/null
+++ b/toolkit/components/webextensions/schemas/dns.json
@@ -0,0 +1,4 @@
+[
+ {"namespace":"manifest","types":[{"$extend":"Permission","choices":[{"type":"string","enum":["dns"]}]}]},
+ {"namespace":"dns","permissions":["dns"],"types":[{"id":"DNSRecord","type":"object","properties":{"addresses":{"type":"array","items":{"type":"string"}},"canonicalName":{"type":"string","optional":true},"isTRR":{"type":"boolean"}}}],"functions":[{"name":"resolve","type":"function","async":"promise","parameters":[{"name":"hostname","type":"string"},{"name":"flags","type":"array","items":{"type":"string"},"optional":true}],"returns":{"$ref":"DNSRecord"}}]}
+]
diff --git a/toolkit/content/widgets/browser.xml b/toolkit/content/widgets/browser.xml
index 839b0551c7..db9f1051f6 100644
--- a/toolkit/content/widgets/browser.xml
+++ b/toolkit/content/widgets/browser.xml
@@ -457,7 +457,7 @@
+ onget="return this.docShell && this.docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIWebProgress);"/>
null
diff --git a/toolkit/modules/addons/MatchPattern.jsm b/toolkit/modules/addons/MatchPattern.jsm
index 4dff81fd23..fd46e1e786 100644
--- a/toolkit/modules/addons/MatchPattern.jsm
+++ b/toolkit/modules/addons/MatchPattern.jsm
@@ -18,7 +18,9 @@ this.EXPORTED_SYMBOLS = ["MatchPattern", "MatchGlobs", "MatchURLFilters"];
/* globals MatchPattern, MatchGlobs */
-const PERMITTED_SCHEMES = ["http", "https", "file", "ftp", "data"];
+// WebExtensions also use WebSocket URLs for request filtering and
+// moz-extension URLs internally when validating web-accessible resources.
+const PERMITTED_SCHEMES = ["http", "https", "file", "ftp", "data", "ws", "wss", "moz-extension"];
const PERMITTED_SCHEMES_REGEXP = PERMITTED_SCHEMES.join("|");
// This function converts a glob pattern (containing * and possibly ?