Loading browser/components/urlbar/QuickActionsLoaderDefault.sys.mjs +38 −1 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ ChromeUtils.defineESModuleGetters(lazy, { ScreenshotsUtils: "moz-src:///browser/components/screenshots/ScreenshotsUtils.sys.mjs", TranslationsParent: "resource://gre/actors/TranslationsParent.sys.mjs", PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs", }); import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs"; Loading Loading @@ -82,6 +83,9 @@ const DEFAULT_ACTIONS = { icon: "chrome://mozapps/skin/extensions/category-extensions.svg", label: "quickactions-addons", onPick: openAddonsUrl("addons://discover/"), // Hide in base-browser, since we don't want to open extensions // "recommendations" tab. tor-browser#43864. disabled: () => true, }, bookmarks: { l10nCommands: ["quickactions-cmd-bookmarks", "quickactions-bookmarks2"], Loading @@ -105,6 +109,12 @@ const DEFAULT_ACTIONS = { .getElementById("Tools:Sanitize") .doCommand(); }, // Disable in permanent private browsing. tor-browser#43864. // NOTE: This should also be disabled in private windows, but we don't have // access to a Window element to check. See mozilla bug 1980912. disabled: () => { return lazy.PrivateBrowsingUtils.permanentPrivateBrowsing; }, }, manageai: { l10nCommands: ["quickactions-cmd-manageai"], Loading @@ -129,13 +139,18 @@ const DEFAULT_ACTIONS = { icon: "chrome://mozapps/skin/extensions/category-extensions.svg", label: "quickactions-extensions", onPick: openAddonsUrl("addons://list/extension"), // Hide in base-browser since we do not want to encourage users to change // their extensions/addons. tor-browser#43864. disabled: () => true, }, help: { l10nCommands: ["quickactions-cmd-help"], icon: "chrome://global/skin/icons/help.svg", label: "quickactions-help", // Open the base-browser support/help page, rather than Firefox's. // tor-browser#43864. onPick: openUrlFun( "https://support.mozilla.org/products/firefox?as=u&utm_source=inproduct" Services.prefs.getStringPref("browser.base-browser-support-url", "") ), }, firefoxview: { Loading @@ -145,6 +160,9 @@ const DEFAULT_ACTIONS = { onPick: (_queryContext, controller) => { controller.browserWindow.FirefoxViewHandler.openTab(); }, // Hide in base-browser since firefoxview is disabled. // tor-browser#43864 and tor-browser#42037. disabled: () => true, }, inspect: { l10nCommands: ["quickactions-cmd-inspector2"], Loading Loading @@ -195,6 +213,10 @@ const DEFAULT_ACTIONS = { icon: "chrome://browser/skin/login.svg", label: "quickactions-logins2", onPick: openUrlFun("about:logins"), // Disabled in base browser since saved passwords is not well supported in // Tor Browser, and should be disabled in Mullvad Browser. // tor-browser#44177. disabled: () => true, }, mute: { l10nCommands: ["quickactions-cmd-mute"], Loading Loading @@ -225,6 +247,10 @@ const DEFAULT_ACTIONS = { onPick: (_queryContext, controller) => { controller.browserWindow.OpenBrowserWindow({ private: true }); }, // Disable in permanent private browsing. tor-browser#44177. disabled: () => { return lazy.PrivateBrowsingUtils.permanentPrivateBrowsing; }, }, refresh: { l10nCommands: ["quickactions-cmd-refresh"], Loading Loading @@ -304,6 +330,12 @@ const DEFAULT_ACTIONS = { ) ); }, // Remove the translate action. Bugzilla bug 1989252 means that the actions // still appears in the full list, despite isVisible being `false`. So we // explicitly remove it from the list instead. tor-browser#43864. disabled() { return !this.isVisible(); }, onPick: async (_queryContext, controller) => { await lazy.TranslationsParent.openAboutTranslationsPage({ browserWindow: controller.browserWindow, Loading Loading @@ -343,6 +375,8 @@ const DEFAULT_ACTIONS = { icon: "chrome://global/skin/icons/experiments.svg", label: "quickactions-labs", onPick: openUrlFun("about:preferences#experimental"), // Disabled in base browser since labs is disabled. tor-browser#44883. disabled: () => true, }, }; Loading Loading @@ -397,6 +431,9 @@ export class QuickActionsLoaderDefault { let keys = Object.keys(DEFAULT_ACTIONS); for (const key of keys) { let actionData = DEFAULT_ACTIONS[key]; if (actionData.disabled?.()) { continue; } let messages = await lazy.gFluentStrings.formatMessages( actionData.l10nCommands.map(id => ({ id })) ); Loading Loading
browser/components/urlbar/QuickActionsLoaderDefault.sys.mjs +38 −1 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ ChromeUtils.defineESModuleGetters(lazy, { ScreenshotsUtils: "moz-src:///browser/components/screenshots/ScreenshotsUtils.sys.mjs", TranslationsParent: "resource://gre/actors/TranslationsParent.sys.mjs", PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs", }); import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs"; Loading Loading @@ -82,6 +83,9 @@ const DEFAULT_ACTIONS = { icon: "chrome://mozapps/skin/extensions/category-extensions.svg", label: "quickactions-addons", onPick: openAddonsUrl("addons://discover/"), // Hide in base-browser, since we don't want to open extensions // "recommendations" tab. tor-browser#43864. disabled: () => true, }, bookmarks: { l10nCommands: ["quickactions-cmd-bookmarks", "quickactions-bookmarks2"], Loading @@ -105,6 +109,12 @@ const DEFAULT_ACTIONS = { .getElementById("Tools:Sanitize") .doCommand(); }, // Disable in permanent private browsing. tor-browser#43864. // NOTE: This should also be disabled in private windows, but we don't have // access to a Window element to check. See mozilla bug 1980912. disabled: () => { return lazy.PrivateBrowsingUtils.permanentPrivateBrowsing; }, }, manageai: { l10nCommands: ["quickactions-cmd-manageai"], Loading @@ -129,13 +139,18 @@ const DEFAULT_ACTIONS = { icon: "chrome://mozapps/skin/extensions/category-extensions.svg", label: "quickactions-extensions", onPick: openAddonsUrl("addons://list/extension"), // Hide in base-browser since we do not want to encourage users to change // their extensions/addons. tor-browser#43864. disabled: () => true, }, help: { l10nCommands: ["quickactions-cmd-help"], icon: "chrome://global/skin/icons/help.svg", label: "quickactions-help", // Open the base-browser support/help page, rather than Firefox's. // tor-browser#43864. onPick: openUrlFun( "https://support.mozilla.org/products/firefox?as=u&utm_source=inproduct" Services.prefs.getStringPref("browser.base-browser-support-url", "") ), }, firefoxview: { Loading @@ -145,6 +160,9 @@ const DEFAULT_ACTIONS = { onPick: (_queryContext, controller) => { controller.browserWindow.FirefoxViewHandler.openTab(); }, // Hide in base-browser since firefoxview is disabled. // tor-browser#43864 and tor-browser#42037. disabled: () => true, }, inspect: { l10nCommands: ["quickactions-cmd-inspector2"], Loading Loading @@ -195,6 +213,10 @@ const DEFAULT_ACTIONS = { icon: "chrome://browser/skin/login.svg", label: "quickactions-logins2", onPick: openUrlFun("about:logins"), // Disabled in base browser since saved passwords is not well supported in // Tor Browser, and should be disabled in Mullvad Browser. // tor-browser#44177. disabled: () => true, }, mute: { l10nCommands: ["quickactions-cmd-mute"], Loading Loading @@ -225,6 +247,10 @@ const DEFAULT_ACTIONS = { onPick: (_queryContext, controller) => { controller.browserWindow.OpenBrowserWindow({ private: true }); }, // Disable in permanent private browsing. tor-browser#44177. disabled: () => { return lazy.PrivateBrowsingUtils.permanentPrivateBrowsing; }, }, refresh: { l10nCommands: ["quickactions-cmd-refresh"], Loading Loading @@ -304,6 +330,12 @@ const DEFAULT_ACTIONS = { ) ); }, // Remove the translate action. Bugzilla bug 1989252 means that the actions // still appears in the full list, despite isVisible being `false`. So we // explicitly remove it from the list instead. tor-browser#43864. disabled() { return !this.isVisible(); }, onPick: async (_queryContext, controller) => { await lazy.TranslationsParent.openAboutTranslationsPage({ browserWindow: controller.browserWindow, Loading Loading @@ -343,6 +375,8 @@ const DEFAULT_ACTIONS = { icon: "chrome://global/skin/icons/experiments.svg", label: "quickactions-labs", onPick: openUrlFun("about:preferences#experimental"), // Disabled in base browser since labs is disabled. tor-browser#44883. disabled: () => true, }, }; Loading Loading @@ -397,6 +431,9 @@ export class QuickActionsLoaderDefault { let keys = Object.keys(DEFAULT_ACTIONS); for (const key of keys) { let actionData = DEFAULT_ACTIONS[key]; if (actionData.disabled?.()) { continue; } let messages = await lazy.gFluentStrings.formatMessages( actionData.l10nCommands.map(id => ({ id })) ); Loading