| ... |
... |
@@ -2,15 +2,14 @@ |
|
2
|
2
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
3
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
4
|
4
|
|
|
5
|
|
-import {
|
|
6
|
|
- actionTypes as at,
|
|
7
|
|
- actionCreators as ac,
|
|
8
|
|
-} from "resource://newtab/common/Actions.mjs";
|
|
9
|
|
-import {
|
|
10
|
|
- WIDGET_REGISTRY,
|
|
11
|
|
- isWidgetToggleVisible,
|
|
12
|
|
- isWidgetsContainerVisible,
|
|
13
|
|
-} from "resource://newtab/common/WidgetsRegistry.mjs";
|
|
|
5
|
+// The newtab extension is not available in base browser, so we replace the
|
|
|
6
|
+// imports with empty objects that we do *not* expect to be used in practice.
|
|
|
7
|
+// See tor-browser#44830.
|
|
|
8
|
+const at = {};
|
|
|
9
|
+const ac = {};
|
|
|
10
|
+const WIDGET_REGISTRY = [];
|
|
|
11
|
+const isWidgetToggleVisible = () => {};
|
|
|
12
|
+const isWidgetsContainerVisible = () => {};
|
|
14
|
13
|
|
|
15
|
14
|
const lazy = {};
|
|
16
|
15
|
ChromeUtils.defineESModuleGetters(lazy, {
|
| ... |
... |
@@ -24,7 +23,7 @@ ChromeUtils.defineESModuleGetters(lazy, { |
|
24
|
23
|
Management: "resource://gre/modules/Extension.sys.mjs",
|
|
25
|
24
|
});
|
|
26
|
25
|
|
|
27
|
|
-const DEFAULT_HOMEPAGE_URL = "about:home";
|
|
|
26
|
+const DEFAULT_HOMEPAGE_URL = "about:tor";
|
|
28
|
27
|
const BLANK_HOMEPAGE_URL = "chrome://browser/content/blanktab.html";
|
|
29
|
28
|
const HOMEPAGE_OVERRIDE_KEY = "homepage_override";
|
|
30
|
29
|
const URL_OVERRIDES_TYPE = "url_overrides";
|
| ... |
... |
@@ -347,6 +346,23 @@ export class AboutPreferences { |
|
347
|
346
|
this.toggleRestoreDefaults(window.gHomePane);
|
|
348
|
347
|
}
|
|
349
|
348
|
|
|
|
349
|
+ /**
|
|
|
350
|
+ * Register the setting groups for base browser.
|
|
|
351
|
+ *
|
|
|
352
|
+ * Added for tor-browser#44830.
|
|
|
353
|
+ *
|
|
|
354
|
+ * @param {Window} window - The about:preferences window.
|
|
|
355
|
+ */
|
|
|
356
|
+ baseBrowserRegisterGroups(window) {
|
|
|
357
|
+ // We do not register the "home" component, since this is specific for
|
|
|
358
|
+ // Firefox Home. tor-browser#44830.
|
|
|
359
|
+ window.MozXULElement.insertFTLIfNeeded("browser/newtab/newtab.ftl");
|
|
|
360
|
+ window.SettingGroupManager.registerGroups({
|
|
|
361
|
+ homepage: this._setupHomepageGroup(window),
|
|
|
362
|
+ customHomepage: this._setupCustomHomepageGroup(window),
|
|
|
363
|
+ });
|
|
|
364
|
+ }
|
|
|
365
|
+
|
|
350
|
366
|
/** @param {Window} window */
|
|
351
|
367
|
_registerPreferences(window) {
|
|
352
|
368
|
const { Preferences } = window;
|
| ... |
... |
@@ -822,10 +838,7 @@ export class AboutPreferences { |
|
822
|
838
|
control: "moz-select",
|
|
823
|
839
|
l10nId: "home-homepage-new-windows",
|
|
824
|
840
|
options: [
|
|
825
|
|
- {
|
|
826
|
|
- value: "home",
|
|
827
|
|
- l10nId: "home-mode-choice-default-fx-srd",
|
|
828
|
|
- },
|
|
|
841
|
+ { value: "home", l10nId: "home-mode-choice-tor" },
|
|
829
|
842
|
{ value: "blank", l10nId: "home-mode-choice-blank-srd" },
|
|
830
|
843
|
{ value: "custom", l10nId: "home-mode-choice-custom-srd" },
|
|
831
|
844
|
],
|
| ... |
... |
@@ -842,10 +855,7 @@ export class AboutPreferences { |
|
842
|
855
|
control: "moz-select",
|
|
843
|
856
|
l10nId: "home-homepage-new-tabs",
|
|
844
|
857
|
options: [
|
|
845
|
|
- {
|
|
846
|
|
- value: "home",
|
|
847
|
|
- l10nId: "home-mode-choice-default-fx-srd",
|
|
848
|
|
- },
|
|
|
858
|
+ { value: "home", l10nId: "home-mode-choice-tor" },
|
|
849
|
859
|
{ value: "blank", l10nId: "home-mode-choice-blank-srd" },
|
|
850
|
860
|
],
|
|
851
|
861
|
},
|