diff options
Diffstat (limited to 'browser/components/shell')
8 files changed, 31 insertions, 13 deletions
diff --git a/browser/components/shell/HeadlessShell.sys.mjs b/browser/components/shell/HeadlessShell.sys.mjs index c87a7a6d56..7882031613 100644 --- a/browser/components/shell/HeadlessShell.sys.mjs +++ b/browser/components/shell/HeadlessShell.sys.mjs @@ -35,7 +35,7 @@ function loadContentWindow(browser, url) { } const principal = Services.scriptSecurityManager.getSystemPrincipal(); - return new Promise((resolve, reject) => { + return new Promise(resolve => { let oa = E10SUtils.predictOriginAttributes({ browser, }); diff --git a/browser/components/shell/ShellService.sys.mjs b/browser/components/shell/ShellService.sys.mjs index c4af0be7de..ed0c86d1a3 100644 --- a/browser/components/shell/ShellService.sys.mjs +++ b/browser/components/shell/ShellService.sys.mjs @@ -9,6 +9,7 @@ const lazy = {}; ChromeUtils.defineESModuleGetters(lazy, { NimbusFeatures: "resource://nimbus/ExperimentAPI.sys.mjs", + ASRouter: "resource:///modules/asrouter/ASRouter.sys.mjs", }); XPCOMUtils.defineLazyServiceGetter( @@ -18,6 +19,13 @@ XPCOMUtils.defineLazyServiceGetter( "nsIXREDirProvider" ); +XPCOMUtils.defineLazyServiceGetter( + lazy, + "BackgroundTasks", + "@mozilla.org/backgroundtasks;1", + "nsIBackgroundTasks" +); + ChromeUtils.defineLazyGetter(lazy, "log", () => { let { ConsoleAPI } = ChromeUtils.importESModule( "resource://gre/modules/Console.sys.mjs" @@ -337,6 +345,16 @@ let ShellServiceInternal = { } this.shellService.setDefaultBrowser(forAllUsers); + + // Disable showing toast notification from Firefox Background Tasks. + if (!lazy.BackgroundTasks?.isBackgroundTaskMode) { + await lazy.ASRouter.waitForInitialized; + const win = Services.wm.getMostRecentBrowserWindow() ?? null; + lazy.ASRouter.sendTriggerMessage({ + browser: win, + id: "deeplinkedToWindowsSettingsUI", + }); + } }, async setAsDefault() { diff --git a/browser/components/shell/content/setDesktopBackground.js b/browser/components/shell/content/setDesktopBackground.js index 7448a3e076..70ab825354 100644 --- a/browser/components/shell/content/setDesktopBackground.js +++ b/browser/components/shell/content/setDesktopBackground.js @@ -234,7 +234,7 @@ if (AppConstants.platform != "macosx") { ); }; } else { - gSetBackground.observe = function (aSubject, aTopic, aData) { + gSetBackground.observe = function (aSubject, aTopic) { if (aTopic == "shell:desktop-background-changed") { document.getElementById("setDesktopBackground").hidden = true; document.getElementById("showDesktopPreferences").hidden = false; diff --git a/browser/components/shell/nsIWindowsShellService.idl b/browser/components/shell/nsIWindowsShellService.idl index 13c824f39c..d28b713a78 100644 --- a/browser/components/shell/nsIWindowsShellService.idl +++ b/browser/components/shell/nsIWindowsShellService.idl @@ -112,7 +112,7 @@ interface nsIWindowsShellService : nsISupports * successful or rejects with an nserror. */ [implicit_jscontext] - Promise pinCurrentAppToTaskbarAsync(in bool aPrivateBrowsing); + Promise pinCurrentAppToTaskbarAsync(in boolean aPrivateBrowsing); /* * Do a dry run of pinCurrentAppToTaskbar(). @@ -128,7 +128,7 @@ interface nsIWindowsShellService : nsISupports * @returns same as pinCurrentAppToTaskbarAsync() */ [implicit_jscontext] - Promise checkPinCurrentAppToTaskbarAsync(in bool aPrivateBrowsing); + Promise checkPinCurrentAppToTaskbarAsync(in boolean aPrivateBrowsing); /* * Search for the current executable among taskbar pins @@ -247,7 +247,7 @@ interface nsIWindowsShellService : nsISupports AString classifyShortcut(in AString aPath); [implicit_jscontext] - Promise hasMatchingShortcut(in AString aAUMID, in bool aPrivateBrowsing); + Promise hasMatchingShortcut(in AString aAUMID, in boolean aPrivateBrowsing); /* * Check if setDefaultBrowserUserChoice() is expected to succeed. @@ -257,7 +257,7 @@ interface nsIWindowsShellService : nsISupports * * @return true if the check succeeds, false otherwise. */ - bool canSetDefaultBrowserUserChoice(); + boolean canSetDefaultBrowserUserChoice(); /* * checkAllProgIDsExist() and checkBrowserUserChoiceHashes() are components @@ -265,8 +265,8 @@ interface nsIWindowsShellService : nsISupports * * @return true if the check succeeds, false otherwise. */ - bool checkAllProgIDsExist(); - bool checkBrowserUserChoiceHashes(); + boolean checkAllProgIDsExist(); + boolean checkBrowserUserChoiceHashes(); /* * Determines whether or not Firefox is the "Default Handler", i.e., diff --git a/browser/components/shell/test/browser_1119088.js b/browser/components/shell/test/browser_1119088.js index bc0995fe51..62fc953f44 100644 --- a/browser/components/shell/test/browser_1119088.js +++ b/browser/components/shell/test/browser_1119088.js @@ -101,7 +101,7 @@ add_task(async function () { gBrowser, url: "about:logo", }, - async browser => { + async () => { let dirSvc = Cc["@mozilla.org/file/directory_service;1"].getService( Ci.nsIDirectoryServiceProvider ); diff --git a/browser/components/shell/test/browser_420786.js b/browser/components/shell/test/browser_420786.js index 025cd87943..9cbdc8c4b7 100644 --- a/browser/components/shell/test/browser_420786.js +++ b/browser/components/shell/test/browser_420786.js @@ -14,7 +14,7 @@ add_task(async function () { gBrowser, url: "about:logo", }, - browser => { + () => { var brandName = Services.strings .createBundle("chrome://branding/locale/brand.properties") .GetStringFromName("brandShortName"); diff --git a/browser/components/shell/test/browser_setDesktopBackgroundPreview.js b/browser/components/shell/test/browser_setDesktopBackgroundPreview.js index b2dbe13db8..b8e2a38dd5 100644 --- a/browser/components/shell/test/browser_setDesktopBackgroundPreview.js +++ b/browser/components/shell/test/browser_setDesktopBackgroundPreview.js @@ -12,7 +12,7 @@ add_task(async function () { gBrowser, url: "about:logo", }, - async browser => { + async () => { const dialogLoad = BrowserTestUtils.domWindowOpened(null, async win => { await BrowserTestUtils.waitForEvent(win, "load"); Assert.equal( diff --git a/browser/components/shell/test/head.js b/browser/components/shell/test/head.js index db1f8811fd..692ba918d0 100644 --- a/browser/components/shell/test/head.js +++ b/browser/components/shell/test/head.js @@ -89,7 +89,7 @@ async function testWindowSizePositive(width, height) { } let data = await IOUtils.read(screenshotPath); - await new Promise((resolve, reject) => { + await new Promise(resolve => { let blob = new Blob([data], { type: "image/png" }); let reader = new FileReader(); reader.onloadend = function () { @@ -126,7 +126,7 @@ async function testGreen(url, path) { } let data = await IOUtils.read(path); - let image = await new Promise((resolve, reject) => { + let image = await new Promise(resolve => { let blob = new Blob([data], { type: "image/png" }); let reader = new FileReader(); reader.onloadend = function () { |