зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1834176 - Convert NetUtil.jsm to be an ES system module. r=arai,webdriver-reviewers,perftest-reviewers,valentin,extension-reviewers,devtools-reviewers,sync-reviewers,cookie-reviewers,robwu,afinder,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D178589
This commit is contained in:
Родитель
860d260a83
Коммит
e3e9a991b8
|
@ -34,6 +34,7 @@ ChromeUtils.defineESModuleGetters(this, {
|
|||
LoginHelper: "resource://gre/modules/LoginHelper.sys.mjs",
|
||||
LoginManagerParent: "resource://gre/modules/LoginManagerParent.sys.mjs",
|
||||
MigrationUtils: "resource:///modules/MigrationUtils.sys.mjs",
|
||||
NetUtil: "resource://gre/modules/NetUtil.sys.mjs",
|
||||
NewTabUtils: "resource://gre/modules/NewTabUtils.sys.mjs",
|
||||
NimbusFeatures: "resource://nimbus/ExperimentAPI.sys.mjs",
|
||||
PageThumbs: "resource://gre/modules/PageThumbs.sys.mjs",
|
||||
|
@ -90,7 +91,6 @@ XPCOMUtils.defineLazyModuleGetters(this, {
|
|||
CustomizableUI: "resource:///modules/CustomizableUI.jsm",
|
||||
ExtensionsUI: "resource:///modules/ExtensionsUI.jsm",
|
||||
HomePage: "resource:///modules/HomePage.jsm",
|
||||
NetUtil: "resource://gre/modules/NetUtil.jsm",
|
||||
OpenInTabsUtils: "resource:///modules/OpenInTabsUtils.jsm",
|
||||
PageActions: "resource:///modules/PageActions.jsm",
|
||||
ProcessHangMonitor: "resource:///modules/ProcessHangMonitor.jsm",
|
||||
|
|
|
@ -3,11 +3,9 @@
|
|||
|
||||
const lazy = {};
|
||||
|
||||
ChromeUtils.defineModuleGetter(
|
||||
lazy,
|
||||
"NetUtil",
|
||||
"resource://gre/modules/NetUtil.jsm"
|
||||
);
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
NetUtil: "resource://gre/modules/NetUtil.sys.mjs",
|
||||
});
|
||||
|
||||
export var PerfTestHelpers = {
|
||||
/**
|
||||
|
|
|
@ -32,6 +32,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
|
|||
Interactions: "resource:///modules/Interactions.sys.mjs",
|
||||
Log: "resource://gre/modules/Log.sys.mjs",
|
||||
LoginBreaches: "resource:///modules/LoginBreaches.sys.mjs",
|
||||
NetUtil: "resource://gre/modules/NetUtil.sys.mjs",
|
||||
NewTabUtils: "resource://gre/modules/NewTabUtils.sys.mjs",
|
||||
NimbusFeatures: "resource://nimbus/ExperimentAPI.sys.mjs",
|
||||
Normandy: "resource://normandy/Normandy.sys.mjs",
|
||||
|
@ -88,7 +89,6 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
|
|||
Discovery: "resource:///modules/Discovery.jsm",
|
||||
ExtensionsUI: "resource:///modules/ExtensionsUI.jsm",
|
||||
HomePage: "resource:///modules/HomePage.jsm",
|
||||
NetUtil: "resource://gre/modules/NetUtil.jsm",
|
||||
OnboardingMessageProvider:
|
||||
"resource://activity-stream/lib/OnboardingMessageProvider.jsm",
|
||||
PageActions: "resource:///modules/PageActions.jsm",
|
||||
|
|
|
@ -4,7 +4,9 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
const { PromiseUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/PromiseUtils.sys.mjs"
|
||||
);
|
||||
|
|
|
@ -34,12 +34,12 @@ ChromeUtils.defineESModuleGetters(lazy, {
|
|||
DownloadHistory: "resource://gre/modules/DownloadHistory.sys.mjs",
|
||||
DownloadUtils: "resource://gre/modules/DownloadUtils.sys.mjs",
|
||||
Downloads: "resource://gre/modules/Downloads.sys.mjs",
|
||||
NetUtil: "resource://gre/modules/NetUtil.sys.mjs",
|
||||
PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs",
|
||||
PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
NetUtil: "resource://gre/modules/NetUtil.jsm",
|
||||
BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm",
|
||||
});
|
||||
|
||||
|
|
|
@ -12,12 +12,12 @@ ChromeUtils.defineESModuleGetters(this, {
|
|||
DownloadsCommon: "resource:///modules/DownloadsCommon.sys.mjs",
|
||||
DownloadsViewUI: "resource:///modules/DownloadsViewUI.sys.mjs",
|
||||
FileUtils: "resource://gre/modules/FileUtils.sys.mjs",
|
||||
NetUtil: "resource://gre/modules/NetUtil.sys.mjs",
|
||||
PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm",
|
||||
NetUtil: "resource://gre/modules/NetUtil.jsm",
|
||||
});
|
||||
|
||||
/**
|
||||
|
|
|
@ -38,13 +38,9 @@ var { XPCOMUtils } = ChromeUtils.importESModule(
|
|||
ChromeUtils.defineESModuleGetters(this, {
|
||||
DownloadsViewUI: "resource:///modules/DownloadsViewUI.sys.mjs",
|
||||
FileUtils: "resource://gre/modules/FileUtils.sys.mjs",
|
||||
NetUtil: "resource://gre/modules/NetUtil.sys.mjs",
|
||||
PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs",
|
||||
});
|
||||
ChromeUtils.defineModuleGetter(
|
||||
this,
|
||||
"NetUtil",
|
||||
"resource://gre/modules/NetUtil.jsm"
|
||||
);
|
||||
|
||||
const { Integration } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/Integration.sys.mjs"
|
||||
|
|
|
@ -3,13 +3,9 @@ ChromeUtils.defineESModuleGetters(this, {
|
|||
DownloadsCommon: "resource:///modules/DownloadsCommon.sys.mjs",
|
||||
FileTestUtils: "resource://testing-common/FileTestUtils.sys.mjs",
|
||||
FileUtils: "resource://gre/modules/FileUtils.sys.mjs",
|
||||
NetUtil: "resource://gre/modules/NetUtil.sys.mjs",
|
||||
TestUtils: "resource://testing-common/TestUtils.sys.mjs",
|
||||
});
|
||||
ChromeUtils.defineModuleGetter(
|
||||
this,
|
||||
"NetUtil",
|
||||
"resource://gre/modules/NetUtil.jsm"
|
||||
);
|
||||
|
||||
async function createDownloadedFile(pathname, contents) {
|
||||
info("createDownloadedFile: " + pathname);
|
||||
|
|
|
@ -12,6 +12,7 @@ const { AppConstants } = ChromeUtils.importESModule(
|
|||
// eslint-disable-next-line no-unused-vars
|
||||
ChromeUtils.defineESModuleGetters(this, {
|
||||
FileUtils: "resource://gre/modules/FileUtils.sys.mjs",
|
||||
NetUtil: "resource://gre/modules/NetUtil.sys.mjs",
|
||||
TestUtils: "resource://testing-common/TestUtils.sys.mjs",
|
||||
});
|
||||
|
||||
|
@ -20,7 +21,6 @@ XPCOMUtils.defineLazyModuleGetters(this, {
|
|||
ExtensionData: "resource://gre/modules/Extension.jsm",
|
||||
ExtensionTestUtils: "resource://testing-common/ExtensionXPCShellUtils.jsm",
|
||||
HttpServer: "resource://testing-common/httpd.js",
|
||||
NetUtil: "resource://gre/modules/NetUtil.jsm",
|
||||
Schemas: "resource://gre/modules/Schemas.jsm",
|
||||
});
|
||||
|
||||
|
|
|
@ -10,7 +10,6 @@ const AUTH_TYPE = {
|
|||
SCHEME_DIGEST: 2,
|
||||
};
|
||||
|
||||
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
|
||||
import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs";
|
||||
import { MigrationUtils } from "resource:///modules/MigrationUtils.sys.mjs";
|
||||
import { MigratorBase } from "resource:///modules/MigratorBase.sys.mjs";
|
||||
|
@ -20,14 +19,11 @@ const lazy = {};
|
|||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
ChromeMigrationUtils: "resource:///modules/ChromeMigrationUtils.sys.mjs",
|
||||
FormHistory: "resource://gre/modules/FormHistory.sys.mjs",
|
||||
NetUtil: "resource://gre/modules/NetUtil.sys.mjs",
|
||||
PlacesUtils: "resource://gre/modules/PlacesUtils.sys.mjs",
|
||||
Qihoo360seMigrationUtils: "resource:///modules/360seMigrationUtils.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
NetUtil: "resource://gre/modules/NetUtil.jsm",
|
||||
});
|
||||
|
||||
/**
|
||||
* Converts an array of chrome bookmark objects into one our own places code
|
||||
* understands.
|
||||
|
|
|
@ -6,7 +6,9 @@ var { MigrationUtils } = ChromeUtils.importESModule(
|
|||
var { LoginHelper } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/LoginHelper.sys.mjs"
|
||||
);
|
||||
var { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
var { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
var { PlacesUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/PlacesUtils.sys.mjs"
|
||||
);
|
||||
|
|
|
@ -1,22 +1,15 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
|
||||
ChromeUtils.defineESModuleGetters(this, {
|
||||
BrowserSearchTelemetry: "resource:///modules/BrowserSearchTelemetry.sys.mjs",
|
||||
NetUtil: "resource://gre/modules/NetUtil.sys.mjs",
|
||||
SearchSERPTelemetry: "resource:///modules/SearchSERPTelemetry.sys.mjs",
|
||||
SearchUtils: "resource://gre/modules/SearchUtils.sys.mjs",
|
||||
TelemetryTestUtils: "resource://testing-common/TelemetryTestUtils.sys.mjs",
|
||||
sinon: "resource://testing-common/Sinon.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
NetUtil: "resource://gre/modules/NetUtil.jsm",
|
||||
});
|
||||
|
||||
const TESTS = [
|
||||
{
|
||||
title: "Google search access point",
|
||||
|
|
|
@ -1,12 +1,9 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
|
||||
ChromeUtils.defineESModuleGetters(this, {
|
||||
BrowserSearchTelemetry: "resource:///modules/BrowserSearchTelemetry.sys.mjs",
|
||||
NetUtil: "resource://gre/modules/NetUtil.sys.mjs",
|
||||
SearchSERPTelemetry: "resource:///modules/SearchSERPTelemetry.sys.mjs",
|
||||
SearchSERPTelemetryUtils: "resource:///modules/SearchSERPTelemetry.sys.mjs",
|
||||
SearchUtils: "resource://gre/modules/SearchUtils.sys.mjs",
|
||||
|
@ -14,10 +11,6 @@ ChromeUtils.defineESModuleGetters(this, {
|
|||
sinon: "resource://testing-common/Sinon.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
NetUtil: "resource://gre/modules/NetUtil.jsm",
|
||||
});
|
||||
|
||||
const TEST_PROVIDER_INFO = [
|
||||
{
|
||||
telemetryId: "example",
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
function handleRequest(request, response) {
|
||||
Cu.importGlobalProperties(["URLSearchParams"]);
|
||||
let { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
let { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
let query = new URLSearchParams(request.queryString);
|
||||
|
||||
response.setHeader("Cross-Origin-Opener-Policy", "same-origin", false);
|
||||
|
|
|
@ -43,7 +43,9 @@
|
|||
*/
|
||||
var EXPORTED_SYMBOLS = ["AeroPeek"];
|
||||
|
||||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
const { PlacesUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/PlacesUtils.sys.mjs"
|
||||
);
|
||||
|
|
|
@ -9,7 +9,7 @@ import { UrlClassifierTestUtils } from "resource://testing-common/UrlClassifierT
|
|||
|
||||
import { SitePermissions } from "resource:///modules/SitePermissions.sys.mjs";
|
||||
|
||||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
import { NetUtil } from "resource://gre/modules/NetUtil.sys.mjs";
|
||||
|
||||
const CC_SELECTORS = ["#identity-popup", "#urlbar-input-container"];
|
||||
const PP_SELECTORS = ["#protections-popup", "#urlbar-input-container"];
|
||||
|
|
|
@ -4,7 +4,9 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
|
||||
function testURL(url) {
|
||||
Services.io.newChannelFromURI(
|
||||
|
|
|
@ -15,12 +15,8 @@ ChromeUtils.defineModuleGetter(
|
|||
);
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
FileUtils: "resource://gre/modules/FileUtils.sys.mjs",
|
||||
NetUtil: "resource://gre/modules/NetUtil.sys.mjs",
|
||||
});
|
||||
ChromeUtils.defineModuleGetter(
|
||||
lazy,
|
||||
"NetUtil",
|
||||
"resource://gre/modules/NetUtil.jsm"
|
||||
);
|
||||
loader.lazyGetter(this, "UNPACKED_ROOT_PATH", () => {
|
||||
return PathUtils.join(PathUtils.localProfileDir, "adb");
|
||||
});
|
||||
|
|
|
@ -6,7 +6,9 @@
|
|||
const { ExtensionTestUtils } = ChromeUtils.import(
|
||||
"resource://testing-common/ExtensionXPCShellUtils.jsm"
|
||||
);
|
||||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
const {
|
||||
getFileForBinary,
|
||||
} = require("resource://devtools/client/shared/remote-debugging/adb/adb-binary.js");
|
||||
|
|
|
@ -40,12 +40,8 @@ loader.lazyRequireGetter(
|
|||
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
FileUtils: "resource://gre/modules/FileUtils.sys.mjs",
|
||||
NetUtil: "resource://gre/modules/NetUtil.sys.mjs",
|
||||
});
|
||||
ChromeUtils.defineModuleGetter(
|
||||
lazy,
|
||||
"NetUtil",
|
||||
"resource://gre/modules/NetUtil.jsm"
|
||||
);
|
||||
loader.lazyRequireGetter(
|
||||
lazy,
|
||||
"ResponsiveUIManager",
|
||||
|
|
|
@ -27,12 +27,8 @@ loader.lazyGetter(lazy, "BufferStream", () => {
|
|||
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
FileUtils: "resource://gre/modules/FileUtils.sys.mjs",
|
||||
NetUtil: "resource://gre/modules/NetUtil.sys.mjs",
|
||||
});
|
||||
ChromeUtils.defineModuleGetter(
|
||||
lazy,
|
||||
"NetUtil",
|
||||
"resource://gre/modules/NetUtil.jsm"
|
||||
);
|
||||
|
||||
import {
|
||||
getString,
|
||||
|
|
|
@ -10,13 +10,9 @@ const {
|
|||
} = require("resource://devtools/shared/specs/network-content.js");
|
||||
|
||||
const lazy = {};
|
||||
ChromeUtils.defineModuleGetter(
|
||||
lazy,
|
||||
"NetUtil",
|
||||
"resource://gre/modules/NetUtil.jsm"
|
||||
);
|
||||
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
NetUtil: "resource://gre/modules/NetUtil.sys.mjs",
|
||||
NetworkUtils:
|
||||
"resource://devtools/shared/network-observer/NetworkUtils.sys.mjs",
|
||||
});
|
||||
|
|
|
@ -26,7 +26,9 @@ const { worker } = ChromeUtils.import(
|
|||
"resource://devtools/shared/loader/worker-loader.js"
|
||||
);
|
||||
|
||||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
|
||||
// Always log packets when running tests. runxpcshelltests.py will throw
|
||||
// the output away anyway, unless you give it the --verbose flag.
|
||||
|
|
|
@ -523,7 +523,8 @@ Object.defineProperty(exports, "assert", {
|
|||
});
|
||||
|
||||
DevToolsUtils.defineLazyGetter(this, "NetUtil", () => {
|
||||
return ChromeUtils.import("resource://gre/modules/NetUtil.jsm").NetUtil;
|
||||
return ChromeUtils.importESModule("resource://gre/modules/NetUtil.sys.mjs")
|
||||
.NetUtil;
|
||||
});
|
||||
|
||||
/**
|
||||
|
|
|
@ -166,8 +166,8 @@ add_task(async function testParentProcessRequests() {
|
|||
tab.linkedBrowser,
|
||||
[requestUrl],
|
||||
async function (uri) {
|
||||
const { NetUtil } = ChromeUtils.import(
|
||||
"resource://gre/modules/NetUtil.jsm"
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
const channel = NetUtil.newChannel({
|
||||
uri,
|
||||
|
@ -198,8 +198,8 @@ add_task(async function testParentProcessRequests() {
|
|||
secondTab.linkedBrowser,
|
||||
[requestUrl],
|
||||
async function (uri) {
|
||||
const { NetUtil } = ChromeUtils.import(
|
||||
"resource://gre/modules/NetUtil.jsm"
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
const channel = NetUtil.newChannel({
|
||||
uri,
|
||||
|
|
|
@ -10,11 +10,9 @@ loader.lazyRequireGetter(
|
|||
"resource://devtools/shared/DevToolsUtils.js"
|
||||
);
|
||||
const lazy = {};
|
||||
ChromeUtils.defineModuleGetter(
|
||||
lazy,
|
||||
"NetUtil",
|
||||
"resource://gre/modules/NetUtil.jsm"
|
||||
);
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
NetUtil: "resource://gre/modules/NetUtil.sys.mjs",
|
||||
});
|
||||
|
||||
const SHEET_TYPE = {
|
||||
agent: "AGENT_SHEET",
|
||||
|
|
|
@ -20,11 +20,9 @@ XPCOMUtils.defineLazyServiceGetter(
|
|||
"nsIResProtocolHandler"
|
||||
);
|
||||
|
||||
ChromeUtils.defineModuleGetter(
|
||||
lazy,
|
||||
"NetUtil",
|
||||
"resource://gre/modules/NetUtil.jsm"
|
||||
);
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
NetUtil: "resource://gre/modules/NetUtil.sys.mjs",
|
||||
});
|
||||
|
||||
// Define some shortcuts.
|
||||
function* getOwnIdentifiers(x) {
|
||||
|
|
|
@ -2,7 +2,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/. */
|
||||
|
||||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
import { NetUtil } from "resource://gre/modules/NetUtil.sys.mjs";
|
||||
|
||||
/**
|
||||
* A function that can be used as part of a require hook for a
|
||||
|
|
|
@ -67,10 +67,8 @@ const lazy = {};
|
|||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
DevToolsInfaillibleUtils:
|
||||
"resource://devtools/shared/DevToolsInfaillibleUtils.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
NetUtil: "resource://gre/modules/NetUtil.jsm",
|
||||
NetUtil: "resource://gre/modules/NetUtil.sys.mjs",
|
||||
});
|
||||
|
||||
// It would make sense to put this in the above
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
|
||||
|
||||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
import { NetUtil } from "resource://gre/modules/NetUtil.sys.mjs";
|
||||
|
||||
const lazy = {};
|
||||
|
||||
|
|
|
@ -2,21 +2,16 @@
|
|||
* 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/. */
|
||||
|
||||
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
|
||||
|
||||
const lazy = {};
|
||||
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
getResponseCacheObject:
|
||||
"resource://devtools/shared/platform/CacheEntry.sys.mjs",
|
||||
NetUtil: "resource://gre/modules/NetUtil.sys.mjs",
|
||||
NetworkHelper:
|
||||
"resource://devtools/shared/network-observer/NetworkHelper.sys.mjs",
|
||||
NetworkUtils:
|
||||
"resource://devtools/shared/network-observer/NetworkUtils.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
NetUtil: "resource://gre/modules/NetUtil.jsm",
|
||||
getResponseCacheObject:
|
||||
"resource://devtools/shared/platform/CacheEntry.sys.mjs",
|
||||
});
|
||||
|
||||
// Network logging
|
||||
|
|
|
@ -12,7 +12,9 @@ var CC = Components.Constructor;
|
|||
const { require } = ChromeUtils.importESModule(
|
||||
"resource://devtools/shared/loader/Loader.sys.mjs"
|
||||
);
|
||||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
|
||||
// We do not want to log packets by default, because in some tests,
|
||||
// we can be sending large amounts of data. The test harness has
|
||||
|
|
|
@ -7,6 +7,7 @@ var { XPCOMUtils } = ChromeUtils.importESModule(
|
|||
);
|
||||
|
||||
ChromeUtils.defineESModuleGetters(this, {
|
||||
NetUtil: "resource://gre/modules/NetUtil.sys.mjs",
|
||||
SearchTestUtils: "resource://testing-common/SearchTestUtils.sys.mjs",
|
||||
SearchUtils: "resource://gre/modules/SearchUtils.sys.mjs",
|
||||
TestUtils: "resource://testing-common/TestUtils.sys.mjs",
|
||||
|
@ -15,7 +16,6 @@ ChromeUtils.defineESModuleGetters(this, {
|
|||
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||
AddonTestUtils: "resource://testing-common/AddonTestUtils.jsm",
|
||||
HttpServer: "resource://testing-common/httpd.js",
|
||||
NetUtil: "resource://gre/modules/NetUtil.jsm",
|
||||
});
|
||||
|
||||
var profileDir = do_get_profile();
|
||||
|
|
|
@ -30,7 +30,9 @@ var {
|
|||
HttpError,
|
||||
HttpServer,
|
||||
} = ChromeUtils.import("resource://testing-common/httpd.js");
|
||||
var { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
var { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
|
||||
const nsIDocumentEncoder = Ci.nsIDocumentEncoder;
|
||||
const replacementChar =
|
||||
|
|
|
@ -11,7 +11,9 @@ var docbody =
|
|||
'<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body></body></html>';
|
||||
|
||||
function handler(metadata, response) {
|
||||
var { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
var { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
|
||||
let body = NetUtil.readInputStreamToString(
|
||||
metadata.bodyInputStream,
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
"use strict";
|
||||
let { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
let { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
|
||||
function handleRequest(request, response) {
|
||||
response.setStatusLine(request.httpVersion, 200);
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
"use strict";
|
||||
let { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
let { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
Cu.importGlobalProperties(["URLSearchParams"]);
|
||||
|
||||
function loadHTMLFromFile(path) {
|
||||
|
|
|
@ -2,7 +2,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/. */
|
||||
|
||||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
import { NetUtil } from "resource://gre/modules/NetUtil.sys.mjs";
|
||||
|
||||
/** This little class ensures that redirects maintain an https:// origin */
|
||||
function RedirectHttpsOnly() {}
|
||||
|
|
|
@ -6,7 +6,7 @@ import { PushDB } from "resource://gre/modules/PushDB.sys.mjs";
|
|||
import { PushRecord } from "resource://gre/modules/PushRecord.sys.mjs";
|
||||
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
|
||||
|
||||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
import { NetUtil } from "resource://gre/modules/NetUtil.sys.mjs";
|
||||
import { clearTimeout, setTimeout } from "resource://gre/modules/Timer.sys.mjs";
|
||||
|
||||
import { PushCrypto } from "resource://gre/modules/PushCrypto.sys.mjs";
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
|
||||
// Returns the test H/2 server port, throwing if it's missing or invalid.
|
||||
function getTestServerPort() {
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
// SJS file for CSP mochitests
|
||||
|
||||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
|
||||
function loadHTMLFromFile(path) {
|
||||
// Load the HTML to return in the response from file.
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
// Server side js file for bug 910139, see file test_bug910139.html for details.
|
||||
|
||||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
|
||||
function loadResponseFromFile(path) {
|
||||
var testHTMLFile = Components.classes["@mozilla.org/file/directory_service;1"]
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
// * Bug 1004703 - ignore 'unsafe-inline' if nonce- or hash-source specified
|
||||
// * Bug 1198422: should not block inline script if default-src is not specified
|
||||
|
||||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
|
||||
function loadHTMLFromFile(path) {
|
||||
// Load the HTML to return in the response from file.
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
/* eslint-env mozilla/chrome-script */
|
||||
|
||||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
|
||||
Cu.importGlobalProperties(["TextDecoder"]);
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
// SJS file for CSP mochitests
|
||||
"use strict";
|
||||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
Components.utils.importGlobalProperties(["URLSearchParams"]);
|
||||
|
||||
function loadHTMLFromFile(path) {
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
// Custom *.sjs specifically for the needs of Bug
|
||||
// Bug 1139297 - Implement CSP upgrade-insecure-requests directive
|
||||
|
||||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
|
||||
// small red image
|
||||
const IMG_BYTES = atob(
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
|
||||
function ERR(response, msg) {
|
||||
dump("ERROR: " + msg + "\n");
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
* 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/. */
|
||||
|
||||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
const { HttpServer } = ChromeUtils.import("resource://testing-common/httpd.js");
|
||||
|
||||
var httpServer = new HttpServer();
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
const { HttpServer } = ChromeUtils.import("resource://testing-common/httpd.js");
|
||||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
const { HttpServer } = ChromeUtils.import("resource://testing-common/httpd.js");
|
||||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
|
||||
const TEST_PATH = "/https_only_https_first_port";
|
||||
var httpserver = null;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
const { HttpServer } = ChromeUtils.import("resource://testing-common/httpd.js");
|
||||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
const { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
|
|
|
@ -6,7 +6,9 @@
|
|||
* <https://w3c.github.io/webappsec-secure-contexts/#is-origin-trustworthy>.
|
||||
*/
|
||||
|
||||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
|
||||
Services.prefs.setCharPref(
|
||||
"dom.securecontext.allowlist",
|
||||
|
|
|
@ -13,7 +13,9 @@ registerCleanupFunction(async () => {
|
|||
Services.prefs.clearUserPref("network.dns.localDomains");
|
||||
});
|
||||
|
||||
var { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
var { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
|
||||
function readFile(file) {
|
||||
let fstream = Cc["@mozilla.org/network/file-input-stream;1"].createInstance(
|
||||
|
|
|
@ -22,7 +22,9 @@ registerCleanupFunction(async () => {
|
|||
Services.prefs.clearUserPref("network.webtransport.redirect.enabled");
|
||||
});
|
||||
|
||||
var { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
var { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
|
||||
function readFile(file) {
|
||||
let fstream = Cc["@mozilla.org/network/file-input-stream;1"].createInstance(
|
||||
|
|
|
@ -21,7 +21,9 @@ registerCleanupFunction(async () => {
|
|||
Services.prefs.clearUserPref("network.webtransport.redirect.enabled");
|
||||
});
|
||||
|
||||
var { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
var { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
|
||||
function readFile(file) {
|
||||
let fstream = Cc["@mozilla.org/network/file-input-stream;1"].createInstance(
|
||||
|
|
|
@ -12,7 +12,9 @@ const nsIFilePicker = Ci.nsIFilePicker;
|
|||
const STDURLMUT_CTRID = "@mozilla.org/network/standard-url-mutator;1";
|
||||
const nsIURIMutator = Ci.nsIURIMutator;
|
||||
|
||||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
|
||||
var gStop = false;
|
||||
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
* http://creativecommons.org/publicdomain/zero/1.0/
|
||||
*/
|
||||
|
||||
var { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
var { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
|
||||
// Helper to step a generator function and catch a StopIteration exception.
|
||||
function do_run_generator(generator) {
|
||||
|
|
|
@ -8,7 +8,9 @@
|
|||
/* import-globals-from image_load_helpers.js */
|
||||
|
||||
const { HttpServer } = ChromeUtils.import("resource://testing-common/httpd.js");
|
||||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
const ReferrerInfo = Components.Constructor(
|
||||
"@mozilla.org/referrer-info;1",
|
||||
"nsIReferrerInfo",
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
* Tests for imgITools
|
||||
*/
|
||||
|
||||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
|
||||
/*
|
||||
* dumpToFile()
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
const { HttpServer } = ChromeUtils.import("resource://testing-common/httpd.js");
|
||||
|
||||
const ReferrerInfo = Components.Constructor(
|
||||
|
|
|
@ -9,7 +9,9 @@
|
|||
* UTF16 character and mid-surrogate pair
|
||||
*/
|
||||
|
||||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
|
||||
const test = [
|
||||
// 0: Valid surrogate pair
|
||||
|
|
|
@ -11,7 +11,9 @@
|
|||
* is an eight-bit character.
|
||||
*/
|
||||
|
||||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
|
||||
const beBOM = "%FE%FF";
|
||||
const leBOM = "%FF%FE";
|
||||
|
|
|
@ -4,7 +4,9 @@
|
|||
*
|
||||
*/
|
||||
|
||||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
|
||||
const test = [
|
||||
// 0: 0x8e followed by hi byte, not valid JIS X 0201
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
|
||||
var Cc = Components.Constructor;
|
||||
|
||||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
|
||||
const tests = [
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// See https://bugzilla.mozilla.org/show_bug.cgi?id=1273251
|
||||
|
||||
const {NetUtil} = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const {NetUtil} = ChromeUtils.importESModule("resource://gre/modules/NetUtil.sys.mjs");
|
||||
ChromeUtils.importESModule("resource://gre/modules/Timer.sys.mjs");
|
||||
const {TestUtils} = ChromeUtils.importESModule("resource://testing-common/TestUtils.sys.mjs");
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
ChromeUtils.importESModule("resource://gre/modules/Timer.sys.mjs");
|
||||
const {NetUtil} = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const {NetUtil} = ChromeUtils.importESModule("resource://gre/modules/NetUtil.sys.mjs");
|
||||
const {TestUtils} = ChromeUtils.importESModule("resource://testing-common/TestUtils.sys.mjs");
|
||||
|
||||
function getWindowlessBrowser(url) {
|
||||
|
|
|
@ -30,7 +30,7 @@ const {
|
|||
|
||||
g,
|
||||
} = ChromeUtils.import("resource://reftest/globals.jsm");
|
||||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { NetUtil } = ChromeUtils.importESModule("resource://gre/modules/NetUtil.sys.mjs");
|
||||
const { AppConstants } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/AppConstants.sys.mjs"
|
||||
);
|
||||
|
|
|
@ -4,7 +4,9 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
|
||||
// Check that reading non existant inner jars results in the right error
|
||||
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
|
||||
// Regression test for bug 370103 - crash when passing a null listener to
|
||||
// nsIChannel.asyncOpen
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
// Make sure we behave appropriately when asking for content-disposition
|
||||
|
||||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
|
||||
const path = "data/test_bug589292.zip";
|
||||
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
* 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/. */
|
||||
|
||||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
|
||||
// Check that reading non existant inner jars results in the right error
|
||||
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
* 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/. */
|
||||
|
||||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
|
||||
// Check that the zip cache can expire entries from nested jars
|
||||
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
* http://creativecommons.org/publicdomain/zero/1.0/
|
||||
*/
|
||||
|
||||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
|
||||
// Check that we don't crash on reading a directory entry signature
|
||||
|
||||
|
|
|
@ -4,7 +4,9 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
|
||||
const { TelemetryTestUtils } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/TelemetryTestUtils.sys.mjs"
|
||||
|
|
|
@ -8,7 +8,9 @@
|
|||
|
||||
const { Constructor: ctor } = Components;
|
||||
|
||||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
|
||||
const ios = Services.io;
|
||||
const dirSvc = Services.dirsvc;
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
// Should report file not found on non-existent files
|
||||
|
||||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
const path = "data/test_bug333423.zip";
|
||||
|
||||
function run_test() {
|
||||
|
|
|
@ -3,7 +3,9 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
|
||||
// Values taken from using zipinfo to list the test.zip contents
|
||||
var TESTS = [
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
* 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/. */
|
||||
|
||||
var EXPORTED_SYMBOLS = ["NetUtil"];
|
||||
|
||||
/**
|
||||
* Necko utilities
|
||||
*/
|
||||
|
@ -24,7 +22,7 @@ const BinaryInputStream = Components.Constructor(
|
|||
// //////////////////////////////////////////////////////////////////////////////
|
||||
// // NetUtil Object
|
||||
|
||||
var NetUtil = {
|
||||
export var NetUtil = {
|
||||
/**
|
||||
* Function to perform simple async copying from aSource (an input stream)
|
||||
* to aSink (an output stream). The copy will happen on some background
|
|
@ -303,7 +303,7 @@ elif CONFIG["OS_ARCH"] == "Linux":
|
|||
]
|
||||
|
||||
EXTRA_JS_MODULES += [
|
||||
"NetUtil.jsm",
|
||||
"NetUtil.sys.mjs",
|
||||
]
|
||||
|
||||
DIRS += ["mozurl", "rust-helper", "http-sfv"]
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
|
||||
const URI = Services.io.newURI("http://example.org/");
|
||||
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
const { CookieXPCShellUtils } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/CookieXPCShellUtils.sys.mjs"
|
||||
);
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
|
||||
const BASE_HOST = "example.org";
|
||||
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
|
||||
function setCookie(name, url) {
|
||||
let value = `${name}=${Math.random()}; Path=/; Max-Age=1000; sameSite=none; Secure`;
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
|
||||
function inChildProcess() {
|
||||
return Services.appinfo.processType != Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT;
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
|
||||
function inChildProcess() {
|
||||
return Services.appinfo.processType != Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT;
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
|
||||
function inChildProcess() {
|
||||
return Services.appinfo.processType != Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT;
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
|
||||
function inChildProcess() {
|
||||
return Services.appinfo.processType != Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT;
|
||||
|
|
|
@ -9,7 +9,8 @@
|
|||
/* global ContentTaskUtils, content */
|
||||
|
||||
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
import { NetUtil } from "resource://gre/modules/NetUtil.sys.mjs";
|
||||
|
||||
const info = console.log;
|
||||
|
||||
export var HTTPS_EXAMPLE_ORG = "https://example.org";
|
||||
|
|
|
@ -16,7 +16,9 @@ var linDEBUG = true;
|
|||
var { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
var { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
var { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
|
||||
/**
|
||||
* Constructs a new nsHttpServer instance. This function is intended to
|
||||
|
|
|
@ -6,7 +6,9 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
const { CookieXPCShellUtils } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/CookieXPCShellUtils.sys.mjs"
|
||||
);
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
// Load standard base class for network tests into child process
|
||||
//
|
||||
|
||||
var { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
var { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
var { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
/* import-globals-from ../unit/head_http3.js */
|
||||
|
||||
var { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
var { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
var { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
/* import-globals-from ../unit/head_trr.js */
|
||||
|
||||
var { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
var { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
var { XPCOMUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/XPCOMUtils.sys.mjs"
|
||||
);
|
||||
|
|
|
@ -2,14 +2,12 @@
|
|||
* 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/. */
|
||||
|
||||
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
|
||||
|
||||
import { Domain } from "chrome://remote/content/cdp/domains/Domain.sys.mjs";
|
||||
|
||||
const lazy = {};
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
NetUtil: "resource://gre/modules/NetUtil.jsm",
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
NetUtil: "resource://gre/modules/NetUtil.sys.mjs",
|
||||
});
|
||||
|
||||
const MAX_WINDOW_SIZE = 10000000;
|
||||
|
|
|
@ -9,15 +9,12 @@ const lazy = {};
|
|||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
CommonUtils: "resource://services-common/utils.sys.mjs",
|
||||
EventEmitter: "resource://gre/modules/EventEmitter.sys.mjs",
|
||||
NetUtil: "resource://gre/modules/NetUtil.sys.mjs",
|
||||
|
||||
ChannelEventSinkFactory:
|
||||
"chrome://remote/content/cdp/observers/ChannelEventSink.sys.mjs",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetters(lazy, {
|
||||
NetUtil: "resource://gre/modules/NetUtil.jsm",
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyServiceGetter(
|
||||
lazy,
|
||||
"gActivityDistributor",
|
||||
|
|
|
@ -6,7 +6,9 @@
|
|||
|
||||
const gCertFileTypes = "*.p7b; *.crt; *.cert; *.cer; *.pem; *.der";
|
||||
|
||||
var { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
var { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
|
||||
var key;
|
||||
|
||||
|
|
|
@ -17,7 +17,9 @@ const { HttpServer } = ChromeUtils.import("resource://testing-common/httpd.js");
|
|||
const { MockRegistrar } = ChromeUtils.importESModule(
|
||||
"resource://testing-common/MockRegistrar.sys.mjs"
|
||||
);
|
||||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
const { PromiseUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/PromiseUtils.sys.mjs"
|
||||
);
|
||||
|
|
|
@ -15,7 +15,9 @@ const CertDb = Cc[nsX509CertDB].getService(Ci.nsIX509CertDB);
|
|||
const { FileUtils } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/FileUtils.sys.mjs"
|
||||
);
|
||||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
const { CommonUtils } = ChromeUtils.importESModule(
|
||||
"resource://services-common/utils.sys.mjs"
|
||||
);
|
||||
|
|
|
@ -9,12 +9,8 @@ const lazy = {};
|
|||
|
||||
ChromeUtils.defineESModuleGetters(lazy, {
|
||||
FileUtils: "resource://gre/modules/FileUtils.sys.mjs",
|
||||
NetUtil: "resource://gre/modules/NetUtil.sys.mjs",
|
||||
});
|
||||
ChromeUtils.defineModuleGetter(
|
||||
lazy,
|
||||
"NetUtil",
|
||||
"resource://gre/modules/NetUtil.jsm"
|
||||
);
|
||||
|
||||
import { Preferences } from "resource://gre/modules/Preferences.sys.mjs";
|
||||
|
||||
|
|
|
@ -2,7 +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/. */
|
||||
|
||||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
import { NetUtil } from "resource://gre/modules/NetUtil.sys.mjs";
|
||||
|
||||
import { Log } from "resource://gre/modules/Log.sys.mjs";
|
||||
import { PromiseUtils } from "resource://gre/modules/PromiseUtils.sys.mjs";
|
||||
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче