diff --git a/browser/components/extensions/schemas/windows.json b/browser/components/extensions/schemas/windows.json index 3f0ce35c4a04..5b58eee422d3 100644 --- a/browser/components/extensions/schemas/windows.json +++ b/browser/components/extensions/schemas/windows.json @@ -288,17 +288,8 @@ "description": "The height in pixels of the new window, including the frame. If not specified defaults to a natural height." }, "focused": { - "choices": [ - { - "type": "boolean", - "enum": [true] - }, - { - "type": "boolean", - "enum": [false], - "deprecated": "Opening inactive windows is not supported." - } - ], + "unsupported": true, + "type": "boolean", "optional": true, "description": "If true, opens an active window. If false, opens an inactive window." }, @@ -332,7 +323,8 @@ "optional": true, "description": "A string to add to the beginning of the window title." } - } + }, + "optional": true }, { "type": "function", diff --git a/browser/components/extensions/test/browser/browser_ext_windows_create_params.js b/browser/components/extensions/test/browser/browser_ext_windows_create_params.js index f117dc54fee8..5418a5436a3e 100644 --- a/browser/components/extensions/test/browser/browser_ext_windows_create_params.js +++ b/browser/components/extensions/test/browser/browser_ext_windows_create_params.js @@ -2,12 +2,6 @@ /* vim: set sts=2 sw=2 et tw=80: */ "use strict"; -const { AddonTestUtils } = ChromeUtils.import( - "resource://testing-common/AddonTestUtils.jsm" -); - -AddonTestUtils.initMochitest(this); - // Tests that incompatible parameters can't be used together. add_task(async function testWindowCreateParams() { let extension = ExtensionTestUtils.loadExtension({ @@ -37,59 +31,3 @@ add_task(async function testWindowCreateParams() { await extension.awaitFinish("window-create-params"); await extension.unload(); }); - -// We do not support the focused param, however we do not want -// to fail despite an error when it is passed. This provides -// better code level compatibility with chrome. -add_task(async function testWindowCreateFocused() { - let extension = ExtensionTestUtils.loadExtension({ - async background() { - try { - let window = await browser.windows.create({}); - browser.test.assertEq( - window.focused, - true, - "window is focused without focused param" - ); - await browser.windows.remove(window.id); - window = await browser.windows.create({ focused: true }); - browser.test.assertEq( - window.focused, - true, - "window is focused with focused: true" - ); - await browser.windows.remove(window.id); - window = await browser.windows.create({ focused: false }); - browser.test.assertEq( - window.focused, - true, - "window is focused with focused: false" - ); - await browser.windows.remove(window.id); - browser.test.notifyPass("window-create-params"); - } catch (e) { - browser.test.fail(`${e} :: ${e.stack}`); - browser.test.notifyFail("window-create-params"); - } - }, - }); - - ExtensionTestUtils.failOnSchemaWarnings(false); - let { messages } = await AddonTestUtils.promiseConsoleOutput(async () => { - await extension.startup(); - await extension.awaitFinish("window-create-params"); - await extension.unload(); - }); - - AddonTestUtils.checkMessages( - messages, - { - expected: [ - /Warning processing focused: Opening inactive windows is not supported./, - ], - }, - "Expected warning processing focused" - ); - - ExtensionTestUtils.failOnSchemaWarnings(true); -}); diff --git a/toolkit/components/extensions/Schemas.jsm b/toolkit/components/extensions/Schemas.jsm index 80c0f9afb5e1..2138e1adb60a 100644 --- a/toolkit/components/extensions/Schemas.jsm +++ b/toolkit/components/extensions/Schemas.jsm @@ -516,21 +516,7 @@ class Context { * @param {Error|string} error */ logError(error) { - if (this.cloneScope) { - Cu.reportError( - // Error objects logged using Cu.reportError are not associated - // to the related innerWindowID. This results in a leaked docshell - // since consoleService cannot release the error object when the - // extension global is destroyed. - typeof error == "string" ? error : String(error), - // Report the error with the appropriate stack trace when the - // is related to an actual extension global (instead of being - // related to a manifest validation). - this.principal && ChromeUtils.getCallerLocation(this.principal) - ); - } else { - Cu.reportError(error); - } + Cu.reportError(error); } /**