mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 11:55:49 +00:00
Bug 1306447: Remove b2g support code from WebExtensions. r=aswan
MozReview-Commit-ID: L3g01tpDSwH --HG-- extra : rebase_source : a80f8e390e70cedec8b0bd2684a4da85302253ed
This commit is contained in:
parent
7dd6d048bd
commit
3d9609323b
Binary file not shown.
@ -1,26 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>This page will be modified by the add-on</title>
|
||||
<script>
|
||||
function sendAlertsForNode(node) {
|
||||
alert(node.textContent);
|
||||
var color = window.getComputedStyle(node).getPropertyValue("color");
|
||||
alert(color);
|
||||
}
|
||||
|
||||
function run() {
|
||||
// We need to wait for the next tick because add-ons are injected in the
|
||||
// onload event too.
|
||||
window.setTimeout(function() {
|
||||
sendAlertsForNode(document.getElementById("header"));
|
||||
sendAlertsForNode(document.getElementById("header2"));
|
||||
}, 0);
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="run()">
|
||||
<h1 id="header">Lorem ipsum</h1>
|
||||
<h2 id="header2">Uncustomized content</h2>
|
||||
</body>
|
||||
</html>
|
@ -1,6 +0,0 @@
|
||||
{
|
||||
"name": "Addon app with an invalid name",
|
||||
"description": "Let me inject script and css!",
|
||||
"developer": { "name": "The Mozilla Community" },
|
||||
"package_path" : "application.zip"
|
||||
}
|
@ -1 +0,0 @@
|
||||
Content-Type: application/manifest+json
|
@ -1,13 +0,0 @@
|
||||
{
|
||||
"name": "Addon app",
|
||||
"version": "1.0",
|
||||
"manifest_version": 2,
|
||||
"permissions": ["tabs"],
|
||||
"description": "Let me inject script and css!",
|
||||
"author": "The Mozilla Community",
|
||||
"content_scripts": [
|
||||
{"matches": ["http://mochi.test/tests/dom/apps/tests/addons/index.html"],
|
||||
"js": ["script.js", "script2.js", "invalid.js", "script.js"],
|
||||
"css": ["style.css", "style2.css"]}
|
||||
]
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
// Simple script that changes an element's content.
|
||||
|
||||
var head = document.getElementById("header");
|
||||
head.innerHTML = "Hello World!";
|
||||
|
@ -1,6 +0,0 @@
|
||||
// Simple script that changes an element's content.
|
||||
|
||||
var head = document.getElementById("header2");
|
||||
head.innerHTML = "Customized content";
|
||||
|
||||
|
@ -1,3 +0,0 @@
|
||||
#header {
|
||||
color: red;
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
#header2 {
|
||||
color: blue;
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
{
|
||||
"name": "Addon app",
|
||||
"description": "Let me inject script and css!",
|
||||
"developer": { "name": "The Mozilla Community" },
|
||||
"package_path" : "application.zip",
|
||||
"id": "webextension@mochitest"
|
||||
}
|
@ -1 +0,0 @@
|
||||
Content-Type: application/manifest+json
|
@ -1,12 +1,6 @@
|
||||
[DEFAULT]
|
||||
skip-if = true ### Bug 1255339: blacklist because no more mozApps
|
||||
support-files =
|
||||
addons/application.zip
|
||||
addons/invalid.webapp
|
||||
addons/invalid.webapp^headers^
|
||||
addons/update.webapp
|
||||
addons/update.webapp^headers^
|
||||
addons/index.html
|
||||
chromeAddCert.js
|
||||
common.js
|
||||
file_app.sjs
|
||||
@ -39,10 +33,6 @@ support-files =
|
||||
icon15alternate.png
|
||||
icon48.png
|
||||
|
||||
[test_app_addons.html]
|
||||
skip-if = os == "android" || toolkit == "gonk" || e10s # embed-apps doesn't work in mochitest app
|
||||
[test_app_blocklist.html]
|
||||
skip-if = buildapp != 'mulet' # we need MOZ_B2G defined and the test to run in the parent process.
|
||||
[test_app_enabled.html]
|
||||
[test_app_update.html]
|
||||
skip-if = os == "android" || toolkit == "gonk" || e10s # embed-apps doesn't work in mochitest app
|
||||
|
@ -1,216 +0,0 @@
|
||||
<!DOCTYPE HTML><!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1042881
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bug 923897 - Test apps as addons</title>
|
||||
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="text/javascript" src="common.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
<script type="application/javascript;version=1.7">
|
||||
/**
|
||||
* Test for Bug 923897
|
||||
* This file covers testing addons.
|
||||
*
|
||||
* The setup is as follows:
|
||||
* - app is installed and offers both script and css to inject in
|
||||
* http://mochi.test:8888/tests/dom/apps/tests/addons/index.html
|
||||
*/
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
const baseURL = "http://mochi.test:8888/tests/dom/apps/tests/addons/";
|
||||
|
||||
const appManifestURL = baseURL + "update.webapp";
|
||||
const invalidAppManifestURL = baseURL + "invalid.webapp";
|
||||
|
||||
let gGenerator = runTest();
|
||||
|
||||
function go() {
|
||||
gGenerator.next();
|
||||
}
|
||||
|
||||
function continueTest() {
|
||||
try {
|
||||
gGenerator.next();
|
||||
} catch (e if e instanceof StopIteration) {
|
||||
SpecialPowers.debugUserCustomizations(false);
|
||||
SimpleTest.finish();
|
||||
}
|
||||
}
|
||||
|
||||
function mozAppsError() {
|
||||
ok(false, "mozApps error: " + this.error.name);
|
||||
SpecialPowers.debugUserCustomizations(false);
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
// Triggers one navigation test to the given page.
|
||||
// Waits for alert() messages before tearing down the iframe.
|
||||
function openPage(pageURL, messages) {
|
||||
info("Navigating to " + pageURL);
|
||||
let ifr = document.createElement("iframe");
|
||||
let listener = function(event) {
|
||||
let message = messages.shift();
|
||||
is(event.detail.message, message, "Checking alert message for " + pageURL);
|
||||
if (messages.length == 0) {
|
||||
ifr.removeEventListener("mozbrowsershowmodalprompt", listener);
|
||||
ifr.parentNode.removeChild(ifr);
|
||||
continueTest();
|
||||
}
|
||||
}
|
||||
|
||||
ifr.addEventListener("mozbrowsershowmodalprompt", listener, false);
|
||||
|
||||
// Open an the app url in an iframe.
|
||||
ifr.setAttribute("mozbrowser", "true");
|
||||
ifr.setAttribute("src", pageURL);
|
||||
document.getElementById("container").appendChild(ifr);
|
||||
}
|
||||
|
||||
let apps = [];
|
||||
|
||||
function installApp(manifestURL, expectedError) {
|
||||
info("About to install app at " + manifestURL);
|
||||
let req = navigator.mozApps.installPackage(manifestURL);
|
||||
req.onsuccess = function() {
|
||||
apps.push(req.result);
|
||||
is(req.result.manifestURL, manifestURL, "app installed");
|
||||
if (req.result.installState == "installed") {
|
||||
is(req.result.manifest.version, "1.0", "correct version");
|
||||
is(req.result.installState, "installed", "app downloaded");
|
||||
continueTest();
|
||||
} else {
|
||||
req.result.ondownloadapplied = function() {
|
||||
is(req.result.manifest.version, "1.0", "correct version");
|
||||
is(req.result.installState, "installed", "app downloaded");
|
||||
continueTest();
|
||||
}
|
||||
|
||||
req.result.ondownloaderror = function() {
|
||||
if (expectedError) {
|
||||
is(req.result.downloadError.name, "MANIFEST_MISMATCH");
|
||||
} else {
|
||||
ok(false, "unexpected installation error: " + req.result.downloadError.name);
|
||||
}
|
||||
continueTest();
|
||||
}
|
||||
}
|
||||
}
|
||||
req.onerror = mozAppsError;
|
||||
}
|
||||
|
||||
function runTest() {
|
||||
// Set up.
|
||||
SpecialPowers.allowUnsignedAddons();
|
||||
SpecialPowers.debugUserCustomizations(true);
|
||||
SpecialPowers.pushPrefEnv({'set': [
|
||||
["dom.mozBrowserFramesEnabled", true],
|
||||
["dom.apps.customization.enabled", true],
|
||||
]},continueTest);
|
||||
yield undefined;
|
||||
|
||||
SpecialPowers.pushPermissions(
|
||||
[{ "type": "webapps-manage", "allow": 1, "context": document },
|
||||
{ "type": "browser", "allow": 1, "context": document } ],
|
||||
continueTest);
|
||||
yield undefined;
|
||||
|
||||
SpecialPowers.autoConfirmAppInstall(continueTest);
|
||||
yield undefined;
|
||||
|
||||
SpecialPowers.autoConfirmAppUninstall(continueTest);
|
||||
yield undefined;
|
||||
|
||||
// Install addon app with an invalid manifest.
|
||||
installApp(invalidAppManifestURL, true);
|
||||
yield undefined;
|
||||
|
||||
// Uninstall the invalid app.
|
||||
while (apps.length) {
|
||||
let app = apps.pop();
|
||||
req = navigator.mozApps.mgmt.uninstall(app);
|
||||
req.onsuccess = continueTest;
|
||||
req.onerror = mozAppsError;
|
||||
yield undefined;
|
||||
}
|
||||
|
||||
// Opens the iframe to the test page, initial state.
|
||||
openPage("http://mochi.test:8888/tests/dom/apps/tests/addons/index.html",
|
||||
["Lorem ipsum", "rgb(0, 0, 0)",
|
||||
"Uncustomized content", "rgb(0, 0, 0)"]);
|
||||
yield undefined;
|
||||
|
||||
// Install valid addon app.
|
||||
installApp(appManifestURL, false);
|
||||
yield undefined;
|
||||
|
||||
// Opens the iframe to the test page, customized.
|
||||
openPage("http://mochi.test:8888/tests/dom/apps/tests/addons/index.html",
|
||||
["Hello World!", "rgb(255, 0, 0)",
|
||||
"Customized content", "rgb(0, 0, 255)"]);
|
||||
yield undefined;
|
||||
|
||||
// Disable the app.
|
||||
navigator.mozApps.mgmt.onenabledstatechange = function(event) {
|
||||
ok(true, "onenabledstatechange received");
|
||||
is(event.application.enabled, false, "Application is disabled");
|
||||
is(apps[0].enabled, false, "Application is disabled");
|
||||
continueTest();
|
||||
}
|
||||
|
||||
navigator.mozApps.mgmt.setEnabled(apps[0], false);
|
||||
yield undefined;
|
||||
|
||||
// Opens the iframe to the test page, back to initial state.
|
||||
openPage("http://mochi.test:8888/tests/dom/apps/tests/addons/index.html",
|
||||
["Lorem ipsum", "rgb(0, 0, 0)",
|
||||
"Uncustomized content", "rgb(0, 0, 0)"]);
|
||||
yield undefined;
|
||||
|
||||
// Re-enable the app.
|
||||
navigator.mozApps.mgmt.onenabledstatechange = function(event) {
|
||||
ok(true, "onenabledstatechange received");
|
||||
is(event.application.enabled, true, "Application is enabled");
|
||||
is(apps[0].enabled, true, "Application is enabled");
|
||||
continueTest();
|
||||
}
|
||||
|
||||
navigator.mozApps.mgmt.setEnabled(apps[0], true);
|
||||
yield undefined;
|
||||
|
||||
// Opens the iframe to the test page, customized.
|
||||
openPage("http://mochi.test:8888/tests/dom/apps/tests/addons/index.html",
|
||||
["Hello World!", "rgb(255, 0, 0)",
|
||||
"Customized content", "rgb(0, 0, 255)"]);
|
||||
yield undefined;
|
||||
|
||||
// Clean up after ourselves by uninstalling apps.
|
||||
while (apps.length) {
|
||||
let app = apps.pop();
|
||||
req = navigator.mozApps.mgmt.uninstall(app);
|
||||
req.onsuccess = continueTest;
|
||||
req.onerror = mozAppsError;
|
||||
yield undefined;
|
||||
}
|
||||
|
||||
// Opens the iframe to the test page, back to initial state.
|
||||
openPage("http://mochi.test:8888/tests/dom/apps/tests/addons/index.html",
|
||||
["Lorem ipsum", "rgb(0, 0, 0)",
|
||||
"Uncustomized content", "rgb(0, 0, 0)"]);
|
||||
yield undefined;
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body onload="prepareEnv(go)">
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
<div id="container"></div>
|
||||
</body>
|
||||
</html>
|
@ -1,191 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id={1208242}
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug {1208242}</title>
|
||||
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="text/javascript" src="common.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id={1208242}">Mozilla Bug {1208242}</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="application/javascript;version=1.7">
|
||||
|
||||
var baseURL = "http://mochi.test:8888/tests/dom/apps/tests/addons/";
|
||||
var appManifestURL = baseURL + "update.webapp";
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
var gGenerator = runTest();
|
||||
|
||||
// Utilities to turn off auto update of the blocklist.
|
||||
// Copied from toolkit/mozapps/extensions/test/browser/head.js
|
||||
var gCatMan = SpecialPowers.Cc["@mozilla.org/categorymanager;1"]
|
||||
.getService(SpecialPowers.Ci.nsICategoryManager);
|
||||
|
||||
var UTIMER = "update-timer";
|
||||
var BLOCKLIST = "nsBlocklistService";
|
||||
|
||||
var blocklistUpdateConfig = "@mozilla.org/extensions/blocklist;1,getService,blocklist-background-update-timer,extensions.blocklist.interval,86400";
|
||||
|
||||
function disableBlocklistUpdateTimer() {
|
||||
info("Disabling " + UTIMER + " " + BLOCKLIST);
|
||||
blocklistUpdateConfig = gCatMan.getCategoryEntry(UTIMER, BLOCKLIST);
|
||||
gCatMan.deleteCategoryEntry(UTIMER, BLOCKLIST, true);
|
||||
}
|
||||
|
||||
function enableBlocklistUpdateTimer() {
|
||||
info("Enabling " + UTIMER + " " + BLOCKLIST);
|
||||
gCatMan.addCategoryEntry(UTIMER, BLOCKLIST, blocklistUpdateConfig, false, true);
|
||||
}
|
||||
|
||||
// End of utilities
|
||||
|
||||
function go() {
|
||||
disableBlocklistUpdateTimer();
|
||||
SpecialPowers.allowUnsignedAddons();
|
||||
SpecialPowers.pushPermissions(
|
||||
[{ "type": "webapps-manage", "allow": 1, "context": document }],
|
||||
function() { gGenerator.next() });
|
||||
}
|
||||
|
||||
function continueTest() {
|
||||
try {
|
||||
gGenerator.next();
|
||||
} catch (e if e instanceof StopIteration) {
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
||||
function finish() {
|
||||
enableBlocklistUpdateTimer();
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
function cbError(aEvent) {
|
||||
ok(false, "Error callback invoked " +
|
||||
aEvent.target.error.name + " " + aEvent.target.error.message);
|
||||
finish();
|
||||
}
|
||||
|
||||
function mozAppsError() {
|
||||
ok(false, "mozApps error: " + this.error.name);
|
||||
SpecialPowers.debugUserCustomizations(false);
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
function installApp(manifestURL) {
|
||||
info("About to install app at " + manifestURL);
|
||||
let req = navigator.mozApps.installPackage(manifestURL);
|
||||
req.onsuccess = function() {
|
||||
is(req.result.manifestURL, manifestURL, "app installed");
|
||||
if (req.result.installState == "installed") {
|
||||
is(req.result.manifest.version, "1.0", "correct version");
|
||||
is(req.result.installState, "installed", "app downloaded");
|
||||
continueTest();
|
||||
} else {
|
||||
req.result.ondownloadapplied = function() {
|
||||
is(req.result.manifest.version, "1.0", "correct version");
|
||||
is(req.result.installState, "installed", "app downloaded");
|
||||
continueTest();
|
||||
}
|
||||
|
||||
req.result.ondownloaderror = function() {
|
||||
ok(false, "unexpected installation error: " + req.result.downloadError.name);
|
||||
continueTest();
|
||||
}
|
||||
}
|
||||
}
|
||||
req.onerror = mozAppsError;
|
||||
return req;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test blocking of an add-on.
|
||||
*/
|
||||
function runTest() {
|
||||
SpecialPowers.autoConfirmAppInstall(continueTest);
|
||||
yield undefined;
|
||||
|
||||
SpecialPowers.autoConfirmAppUninstall(continueTest);
|
||||
yield undefined;
|
||||
|
||||
request = navigator.mozApps.mgmt.getAll();
|
||||
request.onerror = cbError;
|
||||
request.onsuccess = continueTest;
|
||||
yield undefined;
|
||||
var initialAppsCount = request.result.length;
|
||||
info("Starting with " + initialAppsCount + " apps installed.");
|
||||
|
||||
// Install valid addon app.
|
||||
var req = installApp(appManifestURL, false);
|
||||
yield undefined;
|
||||
|
||||
var app = req.result;
|
||||
|
||||
ok(app, "App is non-null");
|
||||
is(app.manifestURL, appManifestURL, "App manifest url is correct.");
|
||||
is(app.enabled, true, "App is enabled by default after install.");
|
||||
|
||||
// Check that the app is disabled
|
||||
navigator.mozApps.mgmt.onenabledstatechange = function(event) {
|
||||
ok(true, "onenabledstatechange received");
|
||||
is(event.application.enabled, false, "Application is disabled");
|
||||
continueTest();
|
||||
}
|
||||
|
||||
// Trigger the blocklist by passing an XML blocklist string.
|
||||
var blocklist =
|
||||
`<?xml version="1.0"?>
|
||||
<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist" lastupdate="1443544016000">
|
||||
<emItems>
|
||||
<emItem blockID="i00" id="webextension@mochitest">
|
||||
<versionRange minVersion="0" maxVersion="*" severity="1"> </versionRange>
|
||||
</emItem>
|
||||
</emItems>
|
||||
</blocklist>`;
|
||||
|
||||
var bls = SpecialPowers.Cc["@mozilla.org/extensions/blocklist;1"]
|
||||
.getService(SpecialPowers.Ci.nsIBlocklistService).wrappedJSObject;
|
||||
bls._loadBlocklistFromString(blocklist);
|
||||
|
||||
//navigator.mozApps.mgmt.setEnabled(app, true);
|
||||
yield undefined;
|
||||
|
||||
// Cleaning up after ourselves.
|
||||
navigator.mozApps.mgmt.onuninstall = function(event) {
|
||||
var app = event.application;
|
||||
is(app.manifestURL, appManifestURL, "App uninstall event ok.");
|
||||
is(app.manifest.name, "Addon app", "App uninstall manifest ok.");
|
||||
continueTest();
|
||||
}
|
||||
request = navigator.mozApps.mgmt.uninstall(app);
|
||||
request.onerror = cbError;
|
||||
request.onsuccess = continueTest;
|
||||
yield undefined;
|
||||
yield undefined;
|
||||
is(request.result, appManifestURL, "App uninstalled.");
|
||||
navigator.mozApps.mgmt.onuninstall = null;
|
||||
|
||||
request = navigator.mozApps.mgmt.getAll();
|
||||
request.onerror = cbError;
|
||||
request.onsuccess = continueTest;
|
||||
yield undefined;
|
||||
is(request.result.length, initialAppsCount, "All apps are uninstalled.");
|
||||
}
|
||||
|
||||
addLoadEvent(() => prepareEnv(go));
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
@ -900,20 +900,14 @@ this.ExtensionData = class {
|
||||
return results;
|
||||
}
|
||||
|
||||
if (!(this.rootURI instanceof Ci.nsIJARURI &&
|
||||
this.rootURI.JARFile instanceof Ci.nsIFileURL)) {
|
||||
// This currently happens for app:// URLs passed to us by
|
||||
// UserCustomizations.jsm
|
||||
return [];
|
||||
}
|
||||
|
||||
// FIXME: We need a way to do this without main thread IO.
|
||||
|
||||
let file = this.rootURI.JARFile.file;
|
||||
let zipReader = Cc["@mozilla.org/libjar/zip-reader;1"].createInstance(Ci.nsIZipReader);
|
||||
try {
|
||||
zipReader.open(file);
|
||||
this.rootURI.QueryInterface(Ci.nsIJARURI);
|
||||
|
||||
let file = this.rootURI.JARFile.QueryInterface(Ci.nsIFileURL).file;
|
||||
let zipReader = Cc["@mozilla.org/libjar/zip-reader;1"].createInstance(Ci.nsIZipReader);
|
||||
zipReader.open(file);
|
||||
try {
|
||||
let results = [];
|
||||
|
||||
// Normalize the directory path.
|
||||
@ -1654,11 +1648,7 @@ this.Extension = class extends ExtensionData {
|
||||
}
|
||||
}).then(() => {
|
||||
if (this.errors.length) {
|
||||
// b2g add-ons generate manifest errors that we've silently
|
||||
// ignoring prior to adding this check.
|
||||
if (!this.rootURI.schemeIs("app")) {
|
||||
return Promise.reject({errors: this.errors});
|
||||
}
|
||||
return Promise.reject({errors: this.errors});
|
||||
}
|
||||
|
||||
if (this.hasShutdown) {
|
||||
|
@ -194,19 +194,12 @@ Script.prototype = {
|
||||
let scheduled = this.run_at || "document_idle";
|
||||
if (shouldRun(scheduled)) {
|
||||
for (let url of this.js) {
|
||||
// On gonk we need to load the resources asynchronously because the
|
||||
// app: channels only support asyncOpen. This is safe only in the
|
||||
// `document_idle` state.
|
||||
if (AppConstants.platform == "gonk" && scheduled != "document_idle") {
|
||||
Cu.reportError(`Script injection: ignoring ${url} at ${scheduled}`);
|
||||
continue;
|
||||
}
|
||||
url = this.extension.baseURI.resolve(url);
|
||||
|
||||
let options = {
|
||||
target: sandbox,
|
||||
charset: "UTF-8",
|
||||
async: AppConstants.platform == "gonk",
|
||||
async: false,
|
||||
};
|
||||
try {
|
||||
result = Services.scriptloader.loadSubScriptWithOptions(url, options);
|
||||
|
@ -156,16 +156,6 @@ var Service = {
|
||||
}
|
||||
|
||||
// Create the moz-extension://uuid mapping.
|
||||
// On b2g, in content processes we can't load jar:file:/// content, so we
|
||||
// switch to jar:remoteopenfile:/// instead
|
||||
// This is mostly exercised by generated extensions in tests. Installed
|
||||
// extensions in b2g get an app: uri that also maps to the right jar: uri.
|
||||
if (AppConstants.MOZ_B2G &&
|
||||
Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_CONTENT &&
|
||||
uri.spec.startsWith("jar:file://")) {
|
||||
uri = Services.io.newURI("jar:remoteopen" + uri.spec.substr("jar:".length), null, null);
|
||||
}
|
||||
|
||||
let handler = Services.io.getProtocolHandler("moz-extension");
|
||||
handler.QueryInterface(Ci.nsISubstitutingProtocolHandler);
|
||||
handler.setSubstitution(uuid, uri);
|
||||
|
@ -254,7 +254,7 @@
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^(https?|file|ftp|app|\\*)://(\\*|\\*\\.[^*/]+|[^*/]+)/.*$"
|
||||
"pattern": "^(https?|file|ftp|\\*)://(\\*|\\*\\.[^*/]+|[^*/]+)/.*$"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
|
@ -19,11 +19,8 @@ skip-if = (os == 'android') # browser.tabs is undefined. Bug 1258975 on android.
|
||||
[test_chrome_native_messaging_paths.html]
|
||||
skip-if = os != "mac" && os != "linux"
|
||||
[test_ext_cookies_expiry.html]
|
||||
skip-if = buildapp == 'b2g'
|
||||
[test_ext_cookies_permissions.html]
|
||||
skip-if = buildapp == 'b2g'
|
||||
[test_ext_jsversion.html]
|
||||
skip-if = buildapp == 'b2g'
|
||||
[test_ext_schema.html]
|
||||
[test_chrome_ext_storage_cleanup.html]
|
||||
[test_chrome_ext_idle.html]
|
||||
|
@ -1,5 +1,4 @@
|
||||
[DEFAULT]
|
||||
skip-if = buildapp == 'mulet' || asan
|
||||
support-files =
|
||||
head.js
|
||||
file_mixed.html
|
||||
@ -45,7 +44,6 @@ skip-if = os == 'android' # Android does not currently support windows.
|
||||
[test_ext_background_canvas.html]
|
||||
[test_ext_content_security_policy.html]
|
||||
[test_ext_contentscript.html]
|
||||
skip-if = buildapp == 'b2g' # runat != document_idle is not supported.
|
||||
[test_ext_contentscript_api_injection.html]
|
||||
[test_ext_contentscript_context.html]
|
||||
[test_ext_contentscript_create_iframe.html]
|
||||
@ -59,22 +57,21 @@ skip-if = (os == 'android') # Android does not support tabs API. Bug 1260250
|
||||
[test_ext_generate.html]
|
||||
[test_ext_notifications.html]
|
||||
[test_ext_permission_xhr.html]
|
||||
skip-if = buildapp == 'b2g' # JavaScript error: jar:remoteopenfile:///data/local/tmp/generated-extension.xpi!/content.js, line 46: NS_ERROR_ILLEGAL_VALUE:
|
||||
[test_ext_runtime_connect.html]
|
||||
skip-if = (os == 'android' || buildapp == 'b2g') # port.sender.tab is undefined on b2g. Bug 1258975 on android.
|
||||
skip-if = os == 'android' # port.sender.tab is undefined on Android (bug 1258975).
|
||||
[test_ext_runtime_connect_twoway.html]
|
||||
skip-if = (os == 'android' || buildapp == 'b2g') # port.sender.tab is undefined on b2g. Bug 1258975 on android.
|
||||
skip-if = os == 'android' # port.sender.tab is undefined on Android (bug 1258975).
|
||||
[test_ext_runtime_connect2.html]
|
||||
skip-if = (os == 'android' || buildapp == 'b2g') # port.sender.tab is undefined on b2g. Bug 1258975 on android.
|
||||
skip-if = os == 'android' # port.sender.tab is undefined on Android (bug 1258975).
|
||||
[test_ext_runtime_disconnect.html]
|
||||
[test_ext_runtime_id.html]
|
||||
[test_ext_sandbox_var.html]
|
||||
[test_ext_sendmessage_reply.html]
|
||||
skip-if = (os == 'android' || buildapp == 'b2g') # sender.tab is undefined on b2g. Bug 1258975 on android.
|
||||
skip-if = os == 'android' # port.sender.tab is undefined on Android (bug 1258975).
|
||||
[test_ext_sendmessage_reply2.html]
|
||||
skip-if = (os == 'android' || buildapp == 'b2g') # sender.tab is undefined on b2g. Bug 1258975 on android.
|
||||
skip-if = os == 'android' # port.sender.tab is undefined on Android (bug 1258975).
|
||||
[test_ext_sendmessage_doublereply.html]
|
||||
skip-if = (os == 'android' || buildapp == 'b2g') # sender.tab is undefined on b2g. Bug 1258975 on android.
|
||||
skip-if = os == 'android' # port.sender.tab is undefined on Android (bug 1258975).
|
||||
[test_ext_sendmessage_no_receiver.html]
|
||||
[test_ext_storage_content.html]
|
||||
[test_ext_storage_tab.html]
|
||||
@ -91,11 +88,11 @@ skip-if = (os == 'android') # Bug 1258975 on android.
|
||||
[test_ext_web_accessible_resources.html]
|
||||
skip-if = (os == 'android') # Bug 1258975 on android.
|
||||
[test_ext_webrequest.html]
|
||||
skip-if = (os == 'android' || buildapp == 'b2g') # webrequest api uninplemented (bug 1199504). Bug 1258975 on android.
|
||||
skip-if = os == 'android' # webrequest api unsupported (bug 1258975).
|
||||
[test_ext_webnavigation.html]
|
||||
skip-if = (os == 'android' || buildapp == 'b2g') # needs TabManager which is not yet implemented. Bug 1258975 on android.
|
||||
skip-if = os == 'android' # port.sender.tab is undefined on Android (bug 1258975).
|
||||
[test_ext_webnavigation_filters.html]
|
||||
skip-if = (os == 'android' || buildapp == 'b2g') # needs TabManager which is not yet implemented. Bug 1258975 on android.
|
||||
skip-if = os == 'android' # port.sender.tab is undefined on Android (bug 1258975).
|
||||
[test_ext_subframes_privileges.html]
|
||||
skip-if = (os == 'android' || buildapp == 'b2g') # neews TabManager which is not yet implemented. Bug 1258975 on android.
|
||||
skip-if = os == 'android' # port.sender.tab is undefined on Android (bug 1258975).
|
||||
[test_ext_xhr_capabilities.html]
|
||||
|
@ -2,7 +2,7 @@
|
||||
head = head.js head_native_messaging.js
|
||||
tail =
|
||||
firefox-appdir = browser
|
||||
skip-if = toolkit == 'gonk' || appname == "thunderbird" || os == "android"
|
||||
skip-if = appname == "thunderbird" || os == "android"
|
||||
subprocess = true
|
||||
support-files =
|
||||
data/**
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
function backgroundScript() {
|
||||
browser.runtime.getPlatformInfo(info => {
|
||||
let validOSs = ["mac", "win", "android", "cros", "linux", "openbsd", "gonk"];
|
||||
let validOSs = ["mac", "win", "android", "cros", "linux", "openbsd"];
|
||||
let validArchs = ["arm", "x86-32", "x86-64"];
|
||||
|
||||
browser.test.assertTrue(validOSs.indexOf(info.os) != -1, "OS is valid");
|
||||
|
@ -2,7 +2,7 @@
|
||||
head = head.js
|
||||
tail =
|
||||
firefox-appdir = browser
|
||||
skip-if = toolkit == 'gonk' || appname == "thunderbird"
|
||||
skip-if = appname == "thunderbird"
|
||||
support-files =
|
||||
data/**
|
||||
tags = webextensions
|
||||
|
@ -18,7 +18,7 @@ this.EXPORTED_SYMBOLS = ["MatchPattern", "MatchGlobs", "MatchURLFilters"];
|
||||
|
||||
/* globals MatchPattern, MatchGlobs */
|
||||
|
||||
const PERMITTED_SCHEMES = ["http", "https", "file", "ftp", "app", "data"];
|
||||
const PERMITTED_SCHEMES = ["http", "https", "file", "ftp", "data"];
|
||||
const PERMITTED_SCHEMES_REGEXP = PERMITTED_SCHEMES.join("|");
|
||||
|
||||
// This function converts a glob pattern (containing * and possibly ?
|
||||
|
Loading…
Reference in New Issue
Block a user