Skip to content

Instantly share code, notes, and snippets.

@piatra
Last active February 26, 2020 18:00
Show Gist options
  • Save piatra/dbf06d0c9b46c0a680d3cb0910e7f907 to your computer and use it in GitHub Desktop.
Save piatra/dbf06d0c9b46c0a680d3cb0910e7f907 to your computer and use it in GitHub Desktop.
diff --git a/browser/components/newtab/AboutNewTabService.jsm b/browser/components/newtab/AboutNewTabService.jsm
index 69390dfbc8a2..30796b29f398 100644
--- a/browser/components/newtab/AboutNewTabService.jsm
+++ b/browser/components/newtab/AboutNewTabService.jsm
@@ -23,6 +23,13 @@ ChromeUtils.defineModuleGetter(
"AboutNewTab",
"resource:///modules/AboutNewTab.jsm"
);
+const PREF_SEPARATE_ABOUT_WELCOME = "browser.aboutwelcome.enabled";
+XPCOMUtils.defineLazyPreferenceGetter(
+ this,
+ "isSeparateAboutWelcome",
+ PREF_SEPARATE_ABOUT_WELCOME,
+ false
+);
const TOPIC_APP_QUIT = "quit-application-granted";
const TOPIC_CONTENT_DOCUMENT_INTERACTIVE = "content-document-interactive";
@@ -41,7 +48,6 @@ const IS_RELEASE_OR_BETA = AppConstants.RELEASE_OR_BETA;
const PREF_SEPARATE_PRIVILEGEDABOUT_CONTENT_PROCESS =
"browser.tabs.remote.separatePrivilegedContentProcess";
const PREF_ACTIVITY_STREAM_DEBUG = "browser.newtabpage.activity-stream.debug";
-const PREF_SEPARATE_ABOUT_WELCOME = "browser.aboutwelcome.enabled";
const SEPARATE_ABOUT_WELCOME_URL =
"resource://activity-stream/aboutwelcome/aboutwelcome.html";
@@ -51,12 +57,6 @@ function AboutNewTabService() {
PREF_SEPARATE_PRIVILEGEDABOUT_CONTENT_PROCESS,
this
);
- XPCOMUtils.defineLazyPreferenceGetter(
- this,
- "isSeparateAboutWelcome",
- PREF_SEPARATE_ABOUT_WELCOME,
- false
- );
if (!IS_RELEASE_OR_BETA) {
Services.prefs.addObserver(PREF_ACTIVITY_STREAM_DEBUG, this);
@@ -158,7 +158,7 @@ AboutNewTabService.prototype = {
// Bail out early for separate about:welcome URL
if (
- this.isSeparateAboutWelcome &&
+ isSeparateAboutWelcome &&
win.location.pathname.includes("welcome")
) {
break;
@@ -276,7 +276,7 @@ AboutNewTabService.prototype = {
* This is calculated in the same way the default URL is.
*/
get welcomeURL() {
- if (this.isSeparateAboutWelcome) {
+ if (isSeparateAboutWelcome) {
return SEPARATE_ABOUT_WELCOME_URL;
}
return this.defaultURL;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment