... |
... |
@@ -13,6 +13,7 @@ ChromeUtils.defineESModuleGetters(lazy, { |
13
|
13
|
ScreenshotsUtils: "resource:///modules/ScreenshotsUtils.sys.mjs",
|
14
|
14
|
ActionsProviderQuickActions:
|
15
|
15
|
"resource:///modules/ActionsProviderQuickActions.sys.mjs",
|
|
16
|
+ PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.sys.mjs",
|
16
|
17
|
});
|
17
|
18
|
|
18
|
19
|
import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs";
|
... |
... |
@@ -78,6 +79,9 @@ const DEFAULT_ACTIONS = { |
78
|
79
|
icon: "chrome://mozapps/skin/extensions/category-extensions.svg",
|
79
|
80
|
label: "quickactions-addons",
|
80
|
81
|
onPick: openAddonsUrl("addons://discover/"),
|
|
82
|
+ // Hide in base-browser, since we don't want to open extensions
|
|
83
|
+ // "recommendations" tab. tor-browser#43864.
|
|
84
|
+ disabled: () => true,
|
81
|
85
|
},
|
82
|
86
|
bookmarks: {
|
83
|
87
|
l10nCommands: ["quickactions-cmd-bookmarks", "quickactions-bookmarks2"],
|
... |
... |
@@ -100,6 +104,12 @@ const DEFAULT_ACTIONS = { |
100
|
104
|
.document.getElementById("Tools:Sanitize")
|
101
|
105
|
.doCommand();
|
102
|
106
|
},
|
|
107
|
+ // Disable in permanent private browsing. tor-browser#43864.
|
|
108
|
+ // NOTE: This should also be disabled in private windows, but we don't have
|
|
109
|
+ // access to a Window element to check. See mozilla bug 1980912.
|
|
110
|
+ disabled: () => {
|
|
111
|
+ return lazy.PrivateBrowsingUtils.permanentPrivateBrowsing;
|
|
112
|
+ },
|
103
|
113
|
},
|
104
|
114
|
downloads: {
|
105
|
115
|
l10nCommands: ["quickactions-cmd-downloads"],
|
... |
... |
@@ -112,13 +122,18 @@ const DEFAULT_ACTIONS = { |
112
|
122
|
icon: "chrome://mozapps/skin/extensions/category-extensions.svg",
|
113
|
123
|
label: "quickactions-extensions",
|
114
|
124
|
onPick: openAddonsUrl("addons://list/extension"),
|
|
125
|
+ // Hide in base-browser since we do not want to encourage users to change
|
|
126
|
+ // their extensions/addons. tor-browser#43864.
|
|
127
|
+ disabled: () => true,
|
115
|
128
|
},
|
116
|
129
|
help: {
|
117
|
130
|
l10nCommands: ["quickactions-cmd-help"],
|
118
|
131
|
icon: "chrome://global/skin/icons/help.svg",
|
119
|
132
|
label: "quickactions-help",
|
|
133
|
+ // Open the base-browser support/help page, rather than Firefox's.
|
|
134
|
+ // tor-browser#43864.
|
120
|
135
|
onPick: openUrlFun(
|
121
|
|
- "https://support.mozilla.org/products/firefox?as=u&utm_source=inproduct"
|
|
136
|
+ Services.prefs.getStringPref("browser.base-browser-support-url", "")
|
122
|
137
|
),
|
123
|
138
|
},
|
124
|
139
|
firefoxview: {
|
... |
... |
@@ -128,6 +143,9 @@ const DEFAULT_ACTIONS = { |
128
|
143
|
onPick: () => {
|
129
|
144
|
lazy.BrowserWindowTracker.getTopWindow().FirefoxViewHandler.openTab();
|
130
|
145
|
},
|
|
146
|
+ // Hide in base-browser since firefoxview is disabled.
|
|
147
|
+ // tor-browser#43864 and tor-browser#42037.
|
|
148
|
+ disabled: () => true,
|
131
|
149
|
},
|
132
|
150
|
inspect: {
|
133
|
151
|
l10nCommands: ["quickactions-cmd-inspector2"],
|
... |
... |
@@ -311,6 +329,9 @@ export class QuickActionsLoaderDefault { |
311
|
329
|
let keys = Object.keys(DEFAULT_ACTIONS);
|
312
|
330
|
for (const key of keys) {
|
313
|
331
|
let actionData = DEFAULT_ACTIONS[key];
|
|
332
|
+ if (actionData.disabled?.()) {
|
|
333
|
+ continue;
|
|
334
|
+ }
|
314
|
335
|
let messages = await lazy.gFluentStrings.formatMessages(
|
315
|
336
|
actionData.l10nCommands.map(id => ({ id }))
|
316
|
337
|
);
|