diff options
Diffstat (limited to 'browser/components/shell/ShellService.sys.mjs')
-rw-r--r-- | browser/components/shell/ShellService.sys.mjs | 18 |
1 files changed, 18 insertions, 0 deletions
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() { |