mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-20 23:37:33 +09:00
fix ubO pt.5
This commit is contained in:
parent
e134fea1ba
commit
ae54ac8e28
8 changed files with 63 additions and 6 deletions
|
|
@ -922,7 +922,9 @@ BrowserGlue.prototype = {
|
||||||
AutoCompletePopup.init();
|
AutoCompletePopup.init();
|
||||||
DateTimePickerHelper.init();
|
DateTimePickerHelper.init();
|
||||||
|
|
||||||
this._firstWindowLoaded();
|
if (typeof this._firstWindowLoaded == "function") {
|
||||||
|
this._firstWindowLoaded();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,8 @@
|
||||||
"choices": [{
|
"choices": [{
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": [
|
"enum": [
|
||||||
"contextMenus"
|
"contextMenus",
|
||||||
|
"menus"
|
||||||
]
|
]
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
|
|
@ -20,7 +21,7 @@
|
||||||
{
|
{
|
||||||
"namespace": "contextMenus",
|
"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.",
|
"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": {
|
"properties": {
|
||||||
"ACTION_MENU_TOP_LEVEL_LIMIT": {
|
"ACTION_MENU_TOP_LEVEL_LIMIT": {
|
||||||
"value": 6,
|
"value": 6,
|
||||||
|
|
|
||||||
|
|
@ -2323,11 +2323,16 @@ JSStructuredCloneReader::readHeader()
|
||||||
return false;
|
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) {
|
if (allowedScope == JS::StructuredCloneScope::DifferentProcessForIndexedDB) {
|
||||||
// Bug 1434308 and bug 1458320 - the scopes stored in old IndexedDB
|
// Bug 1434308 and bug 1458320 - the scopes stored in old IndexedDB
|
||||||
// clones are incorrect. Treat them as if they were DifferentProcess.
|
// clones are incorrect. Treat them as if they were DifferentProcess.
|
||||||
allowedScope = JS::StructuredCloneScope::DifferentProcess;
|
allowedScope = JS::StructuredCloneScope::DifferentProcess;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (storedScope < allowedScope) {
|
if (storedScope < allowedScope) {
|
||||||
|
|
|
||||||
41
toolkit/components/webextensions/ext-dns.js
Normal file
41
toolkit/components/webextensions/ext-dns.js
Normal 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 },
|
||||||
|
}));
|
||||||
|
|
@ -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 i18n chrome://extensions/content/ext-i18n.js
|
||||||
category webextension-scripts idle chrome://extensions/content/ext-idle.js
|
category webextension-scripts idle chrome://extensions/content/ext-idle.js
|
||||||
category webextension-scripts webRequest chrome://extensions/content/ext-webRequest.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 webNavigation chrome://extensions/content/ext-webNavigation.js
|
||||||
category webextension-scripts runtime chrome://extensions/content/ext-runtime.js
|
category webextension-scripts runtime chrome://extensions/content/ext-runtime.js
|
||||||
category webextension-scripts extension chrome://extensions/content/ext-extension.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 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_navigation chrome://extensions/content/schemas/web_navigation.json
|
||||||
category webextension-schemas web_request chrome://extensions/content/schemas/web_request.json
|
category webextension-schemas web_request chrome://extensions/content/schemas/web_request.json
|
||||||
|
category webextension-schemas dns chrome://extensions/content/schemas/dns.json
|
||||||
|
|
|
||||||
4
toolkit/components/webextensions/schemas/dns.json
Normal file
4
toolkit/components/webextensions/schemas/dns.json
Normal 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"}}]}
|
||||||
|
]
|
||||||
|
|
@ -457,7 +457,7 @@
|
||||||
|
|
||||||
<property name="webProgress"
|
<property name="webProgress"
|
||||||
readonly="true"
|
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>
|
<field name="_contentWindow">null</field>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,9 @@ this.EXPORTED_SYMBOLS = ["MatchPattern", "MatchGlobs", "MatchURLFilters"];
|
||||||
|
|
||||||
/* globals MatchPattern, MatchGlobs */
|
/* 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("|");
|
const PERMITTED_SCHEMES_REGEXP = PERMITTED_SCHEMES.join("|");
|
||||||
|
|
||||||
// This function converts a glob pattern (containing * and possibly ?
|
// This function converts a glob pattern (containing * and possibly ?
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue