fix ubO pt.5

This commit is contained in:
wuggy 2026-09-14 15:57:30 -07:00
commit ae54ac8e28
8 changed files with 63 additions and 6 deletions

View file

@ -922,7 +922,9 @@ BrowserGlue.prototype = {
AutoCompletePopup.init();
DateTimePickerHelper.init();
this._firstWindowLoaded();
if (typeof this._firstWindowLoaded == "function") {
this._firstWindowLoaded();
}
},
/**

View file

@ -11,7 +11,8 @@
"choices": [{
"type": "string",
"enum": [
"contextMenus"
"contextMenus",
"menus"
]
}]
}
@ -20,7 +21,7 @@
{
"namespace": "contextMenus",
"description": "Use the <code>browser.contextMenus</code> 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,

View file

@ -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) {

View file

@ -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 },
}));

View file

@ -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

View file

@ -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"}}]}
]

View file

@ -457,7 +457,7 @@
<property name="webProgress"
readonly="true"
onget="return this.docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIWebProgress);"/>
onget="return this.docShell && this.docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIWebProgress);"/>
<field name="_contentWindow">null</field>

View file

@ -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 ?