diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /devtools/shared/DevToolsUtils.js | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.tar.xz firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'devtools/shared/DevToolsUtils.js')
-rw-r--r-- | devtools/shared/DevToolsUtils.js | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/devtools/shared/DevToolsUtils.js b/devtools/shared/DevToolsUtils.js index 77a6ec447c..9a38e4eed5 100644 --- a/devtools/shared/DevToolsUtils.js +++ b/devtools/shared/DevToolsUtils.js @@ -16,12 +16,18 @@ var { const lazy = {}; -ChromeUtils.defineESModuleGetters(lazy, { - FileUtils: "resource://gre/modules/FileUtils.sys.mjs", - NetworkHelper: - "resource://devtools/shared/network-observer/NetworkHelper.sys.mjs", - ObjectUtils: "resource://gre/modules/ObjectUtils.sys.mjs", -}); +if (!isWorker) { + ChromeUtils.defineESModuleGetters( + lazy, + { + FileUtils: "resource://gre/modules/FileUtils.sys.mjs", + NetworkHelper: + "resource://devtools/shared/network-observer/NetworkHelper.sys.mjs", + ObjectUtils: "resource://gre/modules/ObjectUtils.sys.mjs", + }, + { global: "contextual" } + ); +} // Native getters which are considered to be side effect free. ChromeUtils.defineLazyGetter(lazy, "sideEffectFreeGetters", () => { @@ -459,7 +465,8 @@ DevToolsUtils.defineLazyGetter(this, "AppConstants", () => { return {}; } return ChromeUtils.importESModule( - "resource://gre/modules/AppConstants.sys.mjs" + "resource://gre/modules/AppConstants.sys.mjs", + { global: "contextual" } ).AppConstants; }); @@ -508,8 +515,9 @@ Object.defineProperty(exports, "assert", { }); DevToolsUtils.defineLazyGetter(this, "NetUtil", () => { - return ChromeUtils.importESModule("resource://gre/modules/NetUtil.sys.mjs") - .NetUtil; + return ChromeUtils.importESModule("resource://gre/modules/NetUtil.sys.mjs", { + global: "contextual", + }).NetUtil; }); /** @@ -893,7 +901,7 @@ exports.showSaveFileDialog = function ( fp.defaultString = suggestedFilename; } - fp.init(parentWindow, null, fp.modeSave); + fp.init(parentWindow.browsingContext, null, fp.modeSave); if (Array.isArray(filters) && filters.length) { for (const { pattern, label } of filters) { fp.appendFilter(label, pattern); |