зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1780543 - Part 5: Add mozilla/chrome-script environment. r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D152430
This commit is contained in:
Родитель
9fa82cdffe
Коммит
a032f53a63
|
@ -1,6 +1,4 @@
|
|||
// assert is available to chrome scripts loaded via SpecialPowers.loadChromeScript.
|
||||
/* global assert */
|
||||
/* eslint-env mozilla/frame-script */
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
|
||||
"use strict";
|
||||
|
||||
|
|
|
@ -34,9 +34,9 @@ add_task(async function test_DE_is_valid_testcase() {
|
|||
],
|
||||
});
|
||||
let chromeScript = SpecialPowers.loadChromeScript(function test_country_data() {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
const {AddressDataLoader} = ChromeUtils.import("resource://autofill/FormAutofillUtils.jsm");
|
||||
let data = AddressDataLoader.getData("DE");
|
||||
/* global addMessageListener */
|
||||
addMessageListener("CheckSubKeys", () => {
|
||||
return !data.defaultLocale.sub_keys;
|
||||
});
|
||||
|
|
|
@ -81,12 +81,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=509055
|
|||
sheTitle = sh.legacySHistory.getEntryAtIndex(sh.index).title;
|
||||
} else {
|
||||
let chromeScript = SpecialPowers.loadChromeScript(() => {
|
||||
// eslint-disable-next-line no-undef
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
addMessageListener("getTitle", browsingContext => {
|
||||
// eslint-disable-next-line no-shadow
|
||||
let sh = browsingContext.sessionHistory;
|
||||
let title = sh.getEntryAtIndex(sh.index).title;
|
||||
// eslint-disable-next-line no-undef
|
||||
sendAsyncMessage("title", title);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -20,17 +20,15 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=
|
|||
let chromeScript = null;
|
||||
if (SpecialPowers.Services.appinfo.sessionHistoryInParent) {
|
||||
chromeScript = SpecialPowers.loadChromeScript(() => {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
function doSend(message, fn) {
|
||||
try {
|
||||
// eslint-disable-next-line no-undef
|
||||
sendAsyncMessage(message, {success: true, value: fn()});
|
||||
} catch(_) {
|
||||
// eslint-disable-next-line no-undef
|
||||
sendAsyncMessage(message, {success: false});
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-undef
|
||||
addMessageListener("requestedIndex", (id) => {
|
||||
doSend("requestedIndex", () => {
|
||||
let shistory = BrowsingContext.get(id).top.sessionHistory;
|
||||
|
|
|
@ -26,17 +26,15 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1375833
|
|||
let chromeScript = null;
|
||||
if (SpecialPowers.Services.appinfo.sessionHistoryInParent) {
|
||||
chromeScript = SpecialPowers.loadChromeScript(() => {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
function doSend(message, fn) {
|
||||
try {
|
||||
// eslint-disable-next-line no-undef
|
||||
sendAsyncMessage(message, {success: true, value: fn()});
|
||||
} catch(_) {
|
||||
// eslint-disable-next-line no-undef
|
||||
sendAsyncMessage(message, {success: false});
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-undef
|
||||
addMessageListener("test1", id => {
|
||||
doSend("test1", () => {
|
||||
let sessionHistory = BrowsingContext.get(id).top.sessionHistory;
|
||||
|
|
|
@ -24,9 +24,11 @@
|
|||
|
||||
function offlineOnline(online) {
|
||||
function offlineFn() {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
Services.io.offline = true;
|
||||
}
|
||||
function onlineFn() {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
Services.io.offline = false;
|
||||
}
|
||||
SpecialPowers.loadChromeScript(online ? onlineFn : offlineFn);
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
/* eslint-env mozilla/chrome-script */
|
||||
|
||||
Cu.importGlobalProperties(["File"]);
|
||||
|
||||
var testFile = Cc["@mozilla.org/file/directory_service;1"]
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
/* eslint-env mozilla/chrome-script */
|
||||
|
||||
var file;
|
||||
Cu.importGlobalProperties(["File"]);
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
/* eslint-env mozilla/chrome-script */
|
||||
|
||||
Cu.importGlobalProperties(["File"]);
|
||||
|
||||
function createFileWithData(message) {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
/* eslint-env mozilla/chrome-script */
|
||||
|
||||
Cu.importGlobalProperties(["File"]);
|
||||
|
||||
var tmpFile;
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
/* eslint-env mozilla/chrome-script */
|
||||
|
||||
Cu.importGlobalProperties(["File"]);
|
||||
|
||||
addMessageListener("file.open", function() {
|
||||
|
|
|
@ -23,6 +23,7 @@ var lastContentType = -1;
|
|||
const testURL = window.location.href + "/this/is/the/test/url";
|
||||
|
||||
function createChromeScript() {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
var categoryManager = Cc["@mozilla.org/categorymanager;1"].getService(
|
||||
Ci.nsICategoryManager
|
||||
);
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
|
||||
function triggerKey() {
|
||||
SpecialPowers.loadChromeScript(() => {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
const { EventUtils } = ChromeUtils.import(
|
||||
"resource://specialpowers/SpecialPowersEventUtils.jsm"
|
||||
);
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
async function testBrowserChildCoalescing() {
|
||||
var ret = new Promise(function(resolve) {
|
||||
SpecialPowers.loadChromeScript(function() {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
var element = this.actorParent.rootFrameLoader.ownerElement;
|
||||
var rect = element.getBoundingClientRect();
|
||||
var win = element.ownerDocument.defaultView;
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
async function fireLotsOfSingleTouchMoves() {
|
||||
var ret = new Promise(function(resolve) {
|
||||
SpecialPowers.loadChromeScript(function() {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
var element = this.actorParent.rootFrameLoader.ownerElement;
|
||||
var rect = element.getBoundingClientRect();
|
||||
var win = element.ownerDocument.defaultView;
|
||||
|
@ -58,6 +59,7 @@
|
|||
async function fireTwoSingleTouches() {
|
||||
var ret = new Promise(function(resolve) {
|
||||
SpecialPowers.loadChromeScript(function() {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
var element = this.actorParent.rootFrameLoader.ownerElement;
|
||||
var rect = element.getBoundingClientRect();
|
||||
var win = element.ownerDocument.defaultView;
|
||||
|
@ -89,6 +91,7 @@
|
|||
async function fireLotsOfMultiTouchMoves() {
|
||||
var ret = new Promise(function(resolve) {
|
||||
SpecialPowers.loadChromeScript(function() {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
var element = this.actorParent.rootFrameLoader.ownerElement;
|
||||
var rect = element.getBoundingClientRect();
|
||||
var win = element.ownerDocument.defaultView;
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
async function fireLotsOfSingleTouchMoves() {
|
||||
var ret = new Promise(function(resolve) {
|
||||
SpecialPowers.loadChromeScript(function() {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
var element = this.actorParent.rootFrameLoader.ownerElement;
|
||||
var rect = element.getBoundingClientRect();
|
||||
var win = element.ownerDocument.defaultView;
|
||||
|
@ -58,6 +59,7 @@
|
|||
async function fireTwoSingleTouches() {
|
||||
var ret = new Promise(function(resolve) {
|
||||
SpecialPowers.loadChromeScript(function() {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
var element = this.actorParent.rootFrameLoader.ownerElement;
|
||||
var rect = element.getBoundingClientRect();
|
||||
var win = element.ownerDocument.defaultView;
|
||||
|
@ -89,6 +91,7 @@
|
|||
async function fireLotsOfMultiTouchMoves() {
|
||||
var ret = new Promise(function(resolve) {
|
||||
SpecialPowers.loadChromeScript(function() {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
var element = this.actorParent.rootFrameLoader.ownerElement;
|
||||
var rect = element.getBoundingClientRect();
|
||||
var win = element.ownerDocument.defaultView;
|
||||
|
|
|
@ -104,6 +104,7 @@ function runTest() {
|
|||
SimpleTest.waitForFocus(function() {
|
||||
/* eslint-disable no-shadow */
|
||||
let chromeScript = SpecialPowers.loadChromeScript(_ => {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
let win = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
win.requestAnimationFrame(() => {
|
||||
win.gBrowser.selectedBrowser.removeAttribute("blank");
|
||||
|
|
|
@ -53,6 +53,7 @@
|
|||
// Until the blank attribute is removed, we can't send scroll events.
|
||||
SimpleTest.waitForFocus(function() {
|
||||
let chromeScript = SpecialPowers.loadChromeScript(_ => {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
let win = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
win.requestAnimationFrame(() => {
|
||||
win.gBrowser.selectedBrowser.removeAttribute("blank");
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
/* eslint-env mozilla/chrome-script */
|
||||
|
||||
Cu.importGlobalProperties(["File"]);
|
||||
|
||||
addMessageListener("file.open", function(e) {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
/* eslint-env mozilla/chrome-script */
|
||||
|
||||
Cu.importGlobalProperties(["File"]);
|
||||
|
||||
addMessageListener("create-file-objects", function(message) {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
/* eslint-env mozilla/chrome-script */
|
||||
|
||||
Cu.importGlobalProperties(["File"]);
|
||||
|
||||
function createFileWithData(fileData) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* eslint-env mozilla/frame-script */
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
// eslint-disable-next-line mozilla/reject-importGlobalProperties
|
||||
Cu.importGlobalProperties(["File", "Directory"]);
|
||||
var tmpFile, tmpDir;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* eslint-env mozilla/frame-script */
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
// eslint-disable-next-line mozilla/reject-importGlobalProperties
|
||||
Cu.importGlobalProperties(["File"]);
|
||||
function createProfDFile() {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* eslint-env mozilla/frame-script */
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
|
||||
let dialogObserverTopic = "common-dialog-loaded";
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
/* eslint-env mozilla/chrome-script */
|
||||
|
||||
addMessageListener("getCookieFromManager", ({ host, path }) => {
|
||||
let cm = Cc["@mozilla.org/cookiemanager;1"].getService(Ci.nsICookieManager);
|
||||
let values = [];
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
/* eslint-env mozilla/chrome-script */
|
||||
|
||||
Cu.importGlobalProperties(["File"]);
|
||||
|
||||
addMessageListener("files.open", function(message) {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
/* eslint-env mozilla/chrome-script */
|
||||
|
||||
Cu.importGlobalProperties(["File"]);
|
||||
|
||||
addMessageListener("file.open", function(e) {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
/* eslint-env mozilla/chrome-script */
|
||||
|
||||
Cu.importGlobalProperties(["File"]);
|
||||
|
||||
var file;
|
||||
|
|
|
@ -12,11 +12,11 @@ Test that the preallocated process starts up.
|
|||
|
||||
<script type="application/javascript">
|
||||
"use strict";
|
||||
/* eslint-env mozilla/frame-script */
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
function expectProcessCreated() {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
return new Promise(resolve => {
|
||||
function parentExpectProcessCreated() {
|
||||
let topic = "ipc:content-initializing";
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
/* eslint-env mozilla/frame-script */
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
|
||||
"use strict";
|
||||
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
|
||||
"use strict";
|
||||
|
||||
// This is only usable from the parent process, even for doing simple stuff like
|
||||
|
|
|
@ -19,9 +19,9 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1429432
|
|||
|
||||
// Add an allow permission for the mochitest origin to test this.
|
||||
let script = SpecialPowers.loadChromeScript(function() {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
let principal = Services.scriptSecurityManager.createContentPrincipalFromOrigin("http://mochi.test:8888");
|
||||
Services.perms.addFromPrincipal(principal, "desktop-notification", Services.perms.ALLOW_ACTION);
|
||||
/* global addMessageListener */
|
||||
addMessageListener("destroy", function() {
|
||||
Services.perms.removeFromPrincipal(principal, "desktop-notification");
|
||||
});
|
||||
|
|
|
@ -28,6 +28,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=782211
|
|||
// processes (with Fission), since the default content-process alerts service
|
||||
// relays messages to the parent process.
|
||||
function mockServicesChromeScript() {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
const MOCK_CID = Components.ID("{dbe37e64-d9a3-402c-8d8a-0826c619f7ad}");
|
||||
const ALERTS_SERVICE_CONTRACT_ID = "@mozilla.org/alerts-service;1";
|
||||
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
|
||||
"use strict";
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
|
||||
"use strict";
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
|
||||
"use strict";
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
|
||||
"use strict";
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
|
||||
"use strict";
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
|
||||
"use strict";
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
|
||||
"use strict";
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
|
||||
"use strict";
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
|
||||
"use strict";
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
|
||||
"use strict";
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
|
||||
"use strict";
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
|
||||
"use strict";
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
|
||||
"use strict";
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* eslint-env mozilla/frame-script */
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
|
||||
"use strict";
|
||||
|
||||
|
|
|
@ -23,8 +23,6 @@ http://creativecommons.org/licenses/publicdomain/
|
|||
</pre>
|
||||
|
||||
<script class="testbody" type="text/javascript">
|
||||
/* eslint-env mozilla/frame-script */
|
||||
|
||||
function debug(str) {
|
||||
// console.log(str + "\n");
|
||||
}
|
||||
|
@ -92,6 +90,7 @@ http://creativecommons.org/licenses/publicdomain/
|
|||
// Load chrome script to change offline status in the
|
||||
// parent process.
|
||||
var offlineChromeScript = SpecialPowers.loadChromeScript(_ => {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
addMessageListener("change-status", function(offline) {
|
||||
// eslint-disable-next-line mozilla/use-services
|
||||
const ioService = Cc["@mozilla.org/network/io-service;1"]
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
/* eslint-env mozilla/chrome-script */
|
||||
|
||||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
|
||||
Cu.importGlobalProperties(["TextDecoder"]);
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
var script = SpecialPowers.loadChromeScript(() => {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
let ignoreCount = 0;
|
||||
function listener(msg) {
|
||||
if(msg.message.includes("Content Security Policy: Ignoring ‘x-frame-options’ because of ‘frame-ancestors’ directive.")) {
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
* type used for content policy checks is of TYPE_SUBDOCUMENT.
|
||||
*/
|
||||
|
||||
/* eslint-env mozilla/frame-script */
|
||||
function createChromeScript() {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
const POLICYNAME = "@mozilla.org/testpolicy;1";
|
||||
const POLICYID = Components.ID("{6cc95ef3-40e1-4d59-87f0-86f100373227}");
|
||||
const EXPECTED_URL =
|
||||
|
|
|
@ -21,8 +21,8 @@ function checkTestsDone() {
|
|||
SimpleTest.finish();
|
||||
}
|
||||
}
|
||||
/* eslint-env mozilla/frame-script */
|
||||
var script = SpecialPowers.loadChromeScript(() => {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
Services.obs.addObserver(function onExamResp(subject, topic, data) {
|
||||
let channel = subject.QueryInterface(Ci.nsIHttpChannel);
|
||||
if (!channel.URI.spec.startsWith("https://example.com")) {
|
||||
|
|
|
@ -25,6 +25,7 @@ async function realTest(noneRequiresSecure) {
|
|||
|
||||
info("Check cookies");
|
||||
let chromeScript = SpecialPowers.loadChromeScript(() => {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
const {sendAsyncMessage} = this;
|
||||
let cookies = { test: null, test2: null, test3: null };
|
||||
|
||||
|
|
|
@ -98,6 +98,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=803225
|
|||
|
||||
// Test 6: mailto protocol
|
||||
let mm = SpecialPowers.loadChromeScript(function launchHandler() {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
var ioService = Cc["@mozilla.org/network/io-service;1"].
|
||||
getService(Ci.nsIIOService);
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@ let testCounter = 0;
|
|||
let testFrame;
|
||||
|
||||
var script = SpecialPowers.loadChromeScript(() => {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
Services.obs.addObserver(function onExamResp(subject, topic, data) {
|
||||
let channel = subject.QueryInterface(Ci.nsIHttpChannel);
|
||||
info("request observed: " + channel.URI.spec);
|
||||
|
@ -36,7 +37,6 @@ var script = SpecialPowers.loadChromeScript(() => {
|
|||
|
||||
ok(!headerPresent, "testing sec-fetch-user header is not set");
|
||||
|
||||
// eslint-disable-next-line no-undef
|
||||
sendAsyncMessage("test-pass");
|
||||
}, "http-on-stop-request");
|
||||
});
|
||||
|
|
|
@ -23,8 +23,8 @@ SimpleTest.waitForExplicitFinish();
|
|||
const REQUEST_URL = "https://example.com/tests/dom/security/test/sec-fetch/file_redirect.sjs";
|
||||
let testPassCounter = 0;
|
||||
|
||||
/* eslint-env mozilla/frame-script */
|
||||
var script = SpecialPowers.loadChromeScript(() => {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
Services.obs.addObserver(function onExamResp(subject, topic, data) {
|
||||
let channel = subject.QueryInterface(Ci.nsIHttpChannel);
|
||||
if (!channel.URI.spec.startsWith("https://example.com/tests/dom/security/test/sec-fetch/file_redirect.sjs")) {
|
||||
|
|
|
@ -23,8 +23,8 @@ SimpleTest.waitForExplicitFinish();
|
|||
const REQUEST_URL = "https://example.com/tests/dom/security/test/sec-fetch/file_redirect.sjs";
|
||||
let testPassCounter = 0;
|
||||
|
||||
/* eslint-env mozilla/frame-script */
|
||||
var script = SpecialPowers.loadChromeScript(() => {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
Services.obs.addObserver(function onExamResp(subject, topic, data) {
|
||||
let channel = subject.QueryInterface(Ci.nsIHttpChannel);
|
||||
if (!channel.URI.spec.startsWith("https://example.com/tests/dom/security/test/sec-fetch/file_redirect.sjs")) {
|
||||
|
|
|
@ -24,8 +24,8 @@ const REQUEST_URL = "https://example.com/tests/dom/security/test/sec-fetch/file_
|
|||
let testPassCounter = 0;
|
||||
let testWindow;
|
||||
|
||||
/* eslint-env mozilla/frame-script */
|
||||
var script = SpecialPowers.loadChromeScript(() => {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
Services.obs.addObserver(function onExamResp(subject, topic, data) {
|
||||
let channel = subject.QueryInterface(Ci.nsIHttpChannel);
|
||||
if (!channel.URI.spec.startsWith("https://example.com/tests/dom/security/test/sec-fetch/file_redirect.sjs")) {
|
||||
|
|
|
@ -21,8 +21,8 @@ function checkTestsDone() {
|
|||
}
|
||||
}
|
||||
|
||||
/* eslint-env mozilla/frame-script */
|
||||
var script = SpecialPowers.loadChromeScript(() => {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
Services.obs.addObserver(function onExamResp(subject, topic, data) {
|
||||
let channel = subject.QueryInterface(Ci.nsIHttpChannel);
|
||||
if (!channel.URI.spec.includes("localhost") ||
|
||||
|
|
|
@ -19,8 +19,8 @@ function checkTestsDone() {
|
|||
}
|
||||
}
|
||||
|
||||
/* eslint-env mozilla/frame-script */
|
||||
var script = SpecialPowers.loadChromeScript(() => {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
Services.obs.addObserver(function onExamResp(subject, topic, data) {
|
||||
let channel = subject.QueryInterface(Ci.nsIHttpChannel);
|
||||
if (!channel.URI.spec.startsWith("https://example.com/tests/dom/security/test/sec-fetch/file_websocket")) {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
/* eslint-env mozilla/chrome-script */
|
||||
|
||||
let consoleListener;
|
||||
|
||||
function ConsoleListener() {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
/* eslint-env mozilla/chrome-script */
|
||||
|
||||
Cu.importGlobalProperties(["File"]);
|
||||
|
||||
addMessageListener("file.open", function(e) {
|
||||
|
|
|
@ -66,6 +66,8 @@
|
|||
|
||||
async function testScopes() {
|
||||
function chromeScriptSource() {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
|
||||
let swm = Cc["@mozilla.org/serviceworkers/manager;1"]
|
||||
.getService(Ci.nsIServiceWorkerManager);
|
||||
let secMan = Cc["@mozilla.org/scriptsecuritymanager;1"]
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
var chromeScript;
|
||||
chromeScript = SpecialPowers.loadChromeScript(_ => {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => resolve());
|
||||
});
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
async function checkForFindDialog() {
|
||||
let chromeScript = SpecialPowers.loadChromeScript(_ => {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
addMessageListener("test:check", () => {
|
||||
let sawFind = false;
|
||||
let findDialog = Services.wm.getMostRecentWindow("findInPage");
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
/* eslint-env mozilla/chrome-script */
|
||||
|
||||
Cu.importGlobalProperties(["File"]);
|
||||
|
||||
addMessageListener("file.open", function(e) {
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
// so that we can dispatch key event in the parent to test
|
||||
// InputTaskManager properly
|
||||
SpecialPowers.loadChromeScript(() => {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
const { EventUtils } = ChromeUtils.import(
|
||||
"resource://specialpowers/SpecialPowersEventUtils.jsm"
|
||||
);
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
setTimeout(function() {
|
||||
input.focus();
|
||||
SpecialPowers.loadChromeScript(() => {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
const { EventUtils } = ChromeUtils.import(
|
||||
"resource://specialpowers/SpecialPowersEventUtils.jsm"
|
||||
);
|
||||
|
|
|
@ -25,8 +25,8 @@ SimpleTest.waitForFocus(runTest);
|
|||
|
||||
|
||||
function runTest() {
|
||||
/* eslint-env mozilla/frame-script */
|
||||
var script = SpecialPowers.loadChromeScript(function() {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
var gPromptInput = null;
|
||||
var os = Services.obs;
|
||||
|
||||
|
|
|
@ -54,8 +54,8 @@ var script;
|
|||
|
||||
var loadListener = async function(evt) {
|
||||
if (loadCount == 0) {
|
||||
/* eslint-env mozilla/frame-script */
|
||||
script = SpecialPowers.loadChromeScript(function() {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
// eslint-disable-next-line mozilla/use-services
|
||||
var dir = Cc["@mozilla.org/file/directory_service;1"]
|
||||
.getService(Ci.nsIProperties)
|
||||
|
|
|
@ -31,8 +31,8 @@ var script;
|
|||
|
||||
var loadListener = async function(evt) {
|
||||
if (firstLoad) {
|
||||
/* eslint-env mozilla/frame-script */
|
||||
script = SpecialPowers.loadChromeScript(function() {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
// eslint-disable-next-line mozilla/use-services
|
||||
var dir = Cc["@mozilla.org/file/directory_service;1"]
|
||||
.getService(Ci.nsIProperties)
|
||||
|
|
|
@ -35,8 +35,8 @@ var { maybeOnSpellCheck } = SpecialPowers.ChromeUtils.import(
|
|||
/** Test for Bug 1205983 **/
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
SimpleTest.waitForFocus(async function() {
|
||||
/* eslint-env mozilla/frame-script */
|
||||
script = SpecialPowers.loadChromeScript(function() {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
// eslint-disable-next-line mozilla/use-services
|
||||
var dir = Cc["@mozilla.org/file/directory_service;1"]
|
||||
.getService(Ci.nsIProperties)
|
||||
|
|
|
@ -42,9 +42,8 @@ let { maybeOnSpellCheck, onSpellCheck } = SpecialPowers.ChromeUtils.import(
|
|||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
SimpleTest.waitForFocus(async function() {
|
||||
/* global actorParent */
|
||||
/* eslint-env mozilla/frame-script */
|
||||
script = SpecialPowers.loadChromeScript(function() {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
var chromeWin = actorParent.rootFrameLoader
|
||||
.ownerElement.ownerGlobal.browsingContext.topChromeWindow;
|
||||
var contextMenu = chromeWin.document.getElementById("contentAreaContextMenu");
|
||||
|
|
|
@ -33,9 +33,8 @@ function getMisspelledWords(editor) {
|
|||
SimpleTest.waitForExplicitFinish();
|
||||
addLoadEvent(start);
|
||||
async function start() {
|
||||
/* global actorParent */
|
||||
/* eslint-env mozilla/frame-script */
|
||||
let script = SpecialPowers.loadChromeScript(() => {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
// eslint-disable-next-line mozilla/use-services
|
||||
let dir = Cc["@mozilla.org/file/directory_service;1"]
|
||||
.getService(Ci.nsIProperties)
|
||||
|
|
|
@ -32,9 +32,8 @@ let {
|
|||
SimpleTest.waitForExplicitFinish();
|
||||
addLoadEvent(start);
|
||||
async function start() {
|
||||
/* global actorParent */
|
||||
/* eslint-env mozilla/frame-script */
|
||||
let script = SpecialPowers.loadChromeScript(() => {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
// eslint-disable-next-line mozilla/use-services
|
||||
let dir = Cc["@mozilla.org/file/directory_service;1"]
|
||||
.getService(Ci.nsIProperties)
|
||||
|
|
|
@ -34,9 +34,8 @@ function getMisspelledWords(editor) {
|
|||
SimpleTest.waitForExplicitFinish();
|
||||
addLoadEvent(start);
|
||||
async function start() {
|
||||
/* global actorParent */
|
||||
/* eslint-env mozilla/frame-script */
|
||||
let script = SpecialPowers.loadChromeScript(() => {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
// eslint-disable-next-line mozilla/use-services
|
||||
let dir = Cc["@mozilla.org/file/directory_service;1"]
|
||||
.getService(Ci.nsIProperties)
|
||||
|
|
|
@ -30,8 +30,8 @@ var script;
|
|||
|
||||
var loadListener = async function(evt) {
|
||||
if (firstLoad) {
|
||||
/* eslint-env mozilla/frame-script */
|
||||
script = SpecialPowers.loadChromeScript(function() {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
// eslint-disable-next-line mozilla/use-services
|
||||
var dir = Cc["@mozilla.org/file/directory_service;1"]
|
||||
.getService(Ci.nsIProperties)
|
||||
|
|
|
@ -34,8 +34,8 @@ var { maybeOnSpellCheck, onSpellCheck } = SpecialPowers.ChromeUtils.import(
|
|||
/** Test for Bug 697981 **/
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
SimpleTest.waitForFocus(async function() {
|
||||
/* eslint-env mozilla/frame-script */
|
||||
script = SpecialPowers.loadChromeScript(function() {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
// eslint-disable-next-line mozilla/use-services
|
||||
var dir = Cc["@mozilla.org/file/directory_service;1"]
|
||||
.getService(Ci.nsIProperties)
|
||||
|
|
|
@ -31,8 +31,8 @@ var script;
|
|||
|
||||
var loadListener = async function(evt) {
|
||||
if (firstLoad) {
|
||||
/* eslint-env mozilla/frame-script */
|
||||
script = SpecialPowers.loadChromeScript(function() {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
// eslint-disable-next-line mozilla/use-services
|
||||
var dir = Cc["@mozilla.org/file/directory_service;1"]
|
||||
.getService(Ci.nsIProperties)
|
||||
|
|
|
@ -54,8 +54,8 @@ var script;
|
|||
|
||||
var loadListener = async function(evt) {
|
||||
if (loadCount == 0) {
|
||||
/* eslint-env mozilla/frame-script */
|
||||
script = SpecialPowers.loadChromeScript(function() {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
// eslint-disable-next-line mozilla/use-services
|
||||
var dir = Cc["@mozilla.org/file/directory_service;1"]
|
||||
.getService(Ci.nsIProperties)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* eslint-env mozilla/frame-script */
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
|
||||
// Chrome scripts are run with synchronous messages, so make sure we're completely
|
||||
// decoupled from the content process before doing this work.
|
||||
|
|
|
@ -23,8 +23,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1272623
|
|||
</pre>
|
||||
<script>
|
||||
|
||||
/* eslint-env mozilla/frame-script */
|
||||
|
||||
/** Test for Bug 1272623 **/
|
||||
|
||||
var maybeOnSpellCheck;
|
||||
|
@ -36,6 +34,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1272623
|
|||
|
||||
// Perform the spelling correction
|
||||
let mm = SpecialPowers.loadChromeScript(function() {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
const {BrowserTestUtils} = ChromeUtils.import("resource://testing-common/BrowserTestUtils.jsm");
|
||||
|
||||
// Chrome scripts are run with synchronous messages, so make sure we're completely
|
||||
|
|
|
@ -566,8 +566,8 @@ async function waitUntilApzStable() {
|
|||
|
||||
// Sadly this helper function cannot reuse any code from other places because
|
||||
// it must be totally self-contained to be shipped over to the parent process.
|
||||
/* eslint-env mozilla/frame-script */
|
||||
function parentProcessFlush() {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
function apzFlush() {
|
||||
var topWin = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
if (!topWin) {
|
||||
|
@ -697,6 +697,7 @@ function isKeyApzEnabled() {
|
|||
// The snapshot is returned in the form of a data URL.
|
||||
function getSnapshot(rect) {
|
||||
function parentProcessSnapshot() {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
addMessageListener("snapshot", function(parentRect) {
|
||||
var topWin = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
if (!topWin) {
|
||||
|
|
|
@ -56,8 +56,8 @@
|
|||
let chromeScriptHandle = null;
|
||||
|
||||
function startListeningForClickEventsInChrome() {
|
||||
/* eslint-env mozilla/frame-script */
|
||||
function chromeScript() {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
let topWin = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
if (!topWin) {
|
||||
topWin = Services.wm.getMostRecentWindow("navigator:geckoview");
|
||||
|
|
|
@ -36,8 +36,8 @@
|
|||
let chromeScriptHandle = null;
|
||||
|
||||
function startListeningForContextmenuEventsInChrome() {
|
||||
/* eslint-env mozilla/frame-script */
|
||||
function chromeScript() {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
let topWin = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
if (!topWin) {
|
||||
topWin = Services.wm.getMostRecentWindow("navigator:geckoview");
|
||||
|
|
|
@ -30,9 +30,9 @@ function listener(callback) {
|
|||
// (in JSON string format) containing the counters.
|
||||
// The 'end' invocation tears down the listeners, and should be invoked once
|
||||
// at the end to clean up. Returns true on success, false on failure.
|
||||
/* eslint-env mozilla/frame-script */
|
||||
function chromeTouchEventCounter(operation) {
|
||||
function chromeProcessCounter() {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
const PREFIX = "apz:ctec:";
|
||||
|
||||
const LISTENERS = {
|
||||
|
|
|
@ -4,14 +4,13 @@ const BLOCKED = 1;
|
|||
async function cleanupData() {
|
||||
await new Promise(resolve => {
|
||||
const chromeScript = SpecialPowers.loadChromeScript(_ => {
|
||||
// eslint-disable-next-line no-undef
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
addMessageListener("go", __ => {
|
||||
Services.clearData.deleteData(
|
||||
Services.clearData.CLEAR_COOKIES |
|
||||
Services.clearData.CLEAR_ALL_CACHES |
|
||||
Services.clearData.CLEAR_DOM_STORAGES,
|
||||
___ => {
|
||||
// eslint-disable-next-line no-undef
|
||||
sendAsyncMessage("done");
|
||||
}
|
||||
);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* eslint-env mozilla/frame-script */
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
|
||||
"use strict";
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* eslint-env mozilla/frame-script */
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
|
||||
"use strict";
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* eslint-env mozilla/frame-script */
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
|
||||
"use strict";
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* eslint-env mozilla/frame-script */
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
/* eslint-disable mozilla/use-services */
|
||||
|
||||
"use strict";
|
||||
|
|
|
@ -11,8 +11,8 @@
|
|||
<script type="text/javascript">
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
/* eslint-env mozilla/frame-script */
|
||||
var script = SpecialPowers.loadChromeScript(() => {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
Services.obs.addObserver(function onExamResp(subject, topic, data) {
|
||||
let channel = subject.QueryInterface(Ci.nsIHttpChannel);
|
||||
if (!channel.URI.spec.startsWith("http://example.org")) {
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
|
||||
<script class="testbody" type="text/javascript">
|
||||
/* sendAsyncMessage isn't actually a global - this just mollifies eslint */
|
||||
/* global sendAsyncMessage */
|
||||
"use strict";
|
||||
|
||||
// We want to start this test from an insecure context
|
||||
|
@ -18,6 +16,7 @@
|
|||
|
||||
async function runTest() {
|
||||
let script = SpecialPowers.loadChromeScript(function() {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
// Force download to be w/o user assistance for our testing mime type
|
||||
const mimeSvc = Cc["@mozilla.org/mime;1"].getService(Ci.nsIMIMEService);
|
||||
let handlerInfo =
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
/* eslint-env mozilla/frame-script */
|
||||
/* global assert */
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
|
||||
// Just receive 'foo' message and forward it back
|
||||
// as 'bar' message
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* eslint-env mozilla/frame-script */
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
|
||||
addMessageListener("ImportTesting:IsModuleLoaded", function(msg) {
|
||||
sendAsyncMessage("ImportTesting:IsModuleLoadedReply", Cu.isModuleLoaded(msg));
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* eslint-env mozilla/frame-script */
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
|
||||
var permChangedObs = {
|
||||
observe(subject, topic, data) {
|
||||
|
|
|
@ -9,8 +9,6 @@
|
|||
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
/* eslint-env mozilla/frame-script */
|
||||
/* global assert */
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
|
@ -38,6 +36,7 @@ function endOfFirstTest() {
|
|||
// wantGlobalProperties should add the specified properties to the sandbox
|
||||
// that is used to run the chrome script.
|
||||
script2 = SpecialPowers.loadChromeScript(_ => {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
addMessageListener("valid-assert", function (message) {
|
||||
assert.equal(typeof XMLHttpRequest, "function", "XMLHttpRequest is defined");
|
||||
assert.equal(typeof CSS, "undefined", "CSS is not defined");
|
||||
|
|
|
@ -9,13 +9,11 @@
|
|||
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
/* eslint-env mozilla/frame-script */
|
||||
/* global assert */
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
|
||||
var script = SpecialPowers.loadChromeScript(function loadChromeScriptTest() {
|
||||
/* eslint-env mozilla/chrome-script */
|
||||
// Copied from SpecialPowersLoadChromeScript.js
|
||||
|
||||
// Just receive 'foo' message and forward it back
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче