Compare commits

..

No commits in common. "e0fe6706d1c8961049d62f253d65893ed5f1e7f8" and "f628239ef33625be41312b3cb64360d62b323492" have entirely different histories.

9 changed files with 4 additions and 108 deletions

View file

@ -11,8 +11,7 @@
"choices": [{
"type": "string",
"enum": [
"contextMenus",
"menus"
"contextMenus"
]
}]
}
@ -21,7 +20,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", "menus"],
"permissions": ["contextMenus"],
"properties": {
"ACTION_MENU_TOP_LEVEL_LIMIT": {
"value": 6,

View file

@ -68,9 +68,7 @@ struct IDBObjectStore::StructuredCloneWriteInfo
uint64_t mOffsetToKeyProp;
explicit StructuredCloneWriteInfo(IDBDatabase* aDatabase)
// DifferentProcessForIndexedDB is a read-only compatibility mode. New
// records must use the durable, cross-process serialization format.
: mCloneBuffer(JS::StructuredCloneScope::DifferentProcess, nullptr,
: mCloneBuffer(JS::StructuredCloneScope::DifferentProcessForIndexedDB, nullptr,
nullptr)
, mDatabase(aDatabase)
, mOffsetToKeyProp(0)

View file

@ -1,49 +0,0 @@
/**
* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/
*/
var testGenerator = testSteps();
function* testSteps() {
const name = "cache-record-roundtrip";
let request = indexedDB.open(name, 1);
request.onerror = errorHandler;
request.onupgradeneeded = event => {
event.target.result.createObjectStore("cache", {keyPath: "key"});
};
request.onsuccess = grabEventAndContinueHandler;
let event = yield undefined;
let db = event.target.result;
let transaction = db.transaction("cache", "readwrite");
transaction.onabort = errorHandler;
transaction.oncomplete = grabEventAndContinueHandler;
let store = transaction.objectStore("cache");
store.put({key: "text", value: "compiled filter data"});
store.put({key: "bytes", value: new Uint8Array([0, 1, 127, 255])});
store.put({key: "empty", value: new ArrayBuffer(0)});
yield undefined;
db.close();
// Reopen after committing: test the serialized database records, rather than
// just observing successful writes or values still held by the caller.
request = indexedDB.open(name, 1);
request.onerror = errorHandler;
request.onsuccess = grabEventAndContinueHandler;
event = yield undefined;
db = event.target.result;
request = db.transaction("cache").objectStore("cache").getAll();
request.onerror = errorHandler;
request.onsuccess = grabEventAndContinueHandler;
event = yield undefined;
let records = event.target.result;
is(records.length, 3, "All committed records are readable");
is(records[0].key, "bytes", "Records retain their keys");
ok(records[0].value instanceof Uint8Array, "Typed array type survives storage");
is(Array.from(records[0].value).join(), "0,1,127,255", "Bytes survive storage");
is(records[1].value.byteLength, 0, "Empty buffers survive storage");
is(records[2].value, "compiled filter data", "Strings survive storage");
db.close();
finishTest();
yield undefined;
}

View file

@ -10,7 +10,6 @@
[test_autoIncrement.js]
[test_autoIncrement_indexes.js]
[test_blocked_order.js]
[test_cache_record_roundtrip.js]
[test_clear.js]
[test_complex_keyPaths.js]
[test_count.js]

View file

@ -1,41 +0,0 @@
"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

@ -47,4 +47,3 @@ 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

@ -1,4 +0,0 @@
[
{"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

@ -218,12 +218,9 @@
"enum": [
"alarms",
"clipboardWrite",
"dns",
"idle",
"notifications",
"privacy",
"storage"
,"unlimitedStorage"
]
},
{ "$ref": "MatchPattern" }

View file

@ -18,9 +18,7 @@ this.EXPORTED_SYMBOLS = ["MatchPattern", "MatchGlobs", "MatchURLFilters"];
/* globals MatchPattern, MatchGlobs */
// 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 = ["http", "https", "file", "ftp", "data"];
const PERMITTED_SCHEMES_REGEXP = PERMITTED_SCHEMES.join("|");
// This function converts a glob pattern (containing * and possibly ?