/* Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ */ "use strict"; /* import-globals-from helper-addons.js */ Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-addons.js", this); // There are shutdown issues for which multiple rejections are left uncaught. // See bug 1018184 for resolving these issues. const { PromiseTestUtils } = ChromeUtils.importESModule( "resource://testing-common/PromiseTestUtils.sys.mjs" ); PromiseTestUtils.allowMatchingRejectionsGlobally(/File closed/); const ADDON_ID = "test-devtools-webextension@mozilla.org"; const ADDON_NAME = "test-devtools-webextension"; /** * Check that the node picker can be used when dynamically navigating to a * webextension popup. */ add_task(async function testNodePickerInExtensionPopup() { await enableExtensionDebugging(); const { document, tab, window } = await openAboutDebugging(); await selectThisFirefoxPage(document, window.AboutDebugging.store); // Note that this extension should not define a background script in order to // reproduce the issue. Otherwise opening the popup does not trigger an auto // navigation from DevTools and you have to use the "Disable Popup Auto Hide" // feature which works around the bug tested here. await installTemporaryExtensionFromXPI( { extraProperties: { browser_action: { default_title: "WebExtension with popup", default_popup: "popup.html", }, }, files: { "popup.html": `