summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2017-11-01 02:42:25 +0100
committerwolfbeast <mcwerewolf@gmail.com>2018-03-13 17:12:06 +0100
commitd2a0a16054771b4b0bee38ee7241a976bc1dac75 (patch)
tree389ca64ef50ada1fe4a7f37b1bd852d2487c82ae
parent240ba54a429c943c45ea87ca0bc4712610c8460f (diff)
downloaduxp-d2a0a16054771b4b0bee38ee7241a976bc1dac75.tar.gz
Hard-disable the use of sponsored tiles.
-rw-r--r--browser/app/profile/firefox.js3
-rw-r--r--browser/base/content/newtab/customize.js17
-rw-r--r--browser/base/content/newtab/newTab.xhtml11
-rw-r--r--toolkit/modules/NewTabUtils.jsm5
-rw-r--r--toolkit/modules/moz.build3
5 files changed, 14 insertions, 25 deletions
diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js
index 94615ded00..d6de538d7a 100644
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -1061,7 +1061,6 @@ pref("services.sync.prefs.sync.browser.download.useDownloadDir", true);
pref("services.sync.prefs.sync.browser.formfill.enable", true);
pref("services.sync.prefs.sync.browser.link.open_newwindow", true);
pref("services.sync.prefs.sync.browser.newtabpage.enabled", true);
-pref("services.sync.prefs.sync.browser.newtabpage.enhanced", true);
pref("services.sync.prefs.sync.browser.newtabpage.pinned", true);
pref("services.sync.prefs.sync.browser.offline-apps.notify", true);
pref("services.sync.prefs.sync.browser.safebrowsing.phishing.enabled", true);
@@ -1156,7 +1155,7 @@ pref("browser.newtabpage.introShown", false);
pref("browser.newtabpage.enabled", true);
// Toggles the enhanced content of 'about:newtab'. Shows sponsored tiles.
-sticky_pref("browser.newtabpage.enhanced", true);
+sticky_pref("browser.newtabpage.enhanced", false);
// enables Activity Stream inspired layout
pref("browser.newtabpage.compact", false);
diff --git a/browser/base/content/newtab/customize.js b/browser/base/content/newtab/customize.js
index 28a52373c6..39724fa910 100644
--- a/browser/base/content/newtab/customize.js
+++ b/browser/base/content/newtab/customize.js
@@ -25,7 +25,6 @@ var gCustomize = {
this._nodes.button.addEventListener("click", e => this.showPanel(e));
this._nodes.blank.addEventListener("click", this);
this._nodes.classic.addEventListener("click", this);
- this._nodes.enhanced.addEventListener("click", this);
this._nodes.learn.addEventListener("click", this);
this.updateSelected();
@@ -87,11 +86,7 @@ var gCustomize = {
sendAsyncMessage("NewTab:Customize", {enabled: false, enhanced: false});
break;
case "newtab-customize-classic":
- if (this._nodes.enhanced.getAttribute("selected")){
- sendAsyncMessage("NewTab:Customize", {enabled: true, enhanced: true});
- } else {
- sendAsyncMessage("NewTab:Customize", {enabled: true, enhanced: false});
- }
+ sendAsyncMessage("NewTab:Customize", {enabled: true, enhanced: false});
break;
case "newtab-customize-enhanced":
sendAsyncMessage("NewTab:Customize", {enabled: true, enhanced: !gAllPages.enhanced});
@@ -114,9 +109,9 @@ var gCustomize = {
},
updateSelected: function() {
- let {enabled, enhanced} = gAllPages;
- let selected = enabled ? enhanced ? "enhanced" : "classic" : "blank";
- ["enhanced", "classic", "blank"].forEach(id => {
+ let {enabled} = gAllPages;
+ let selected = enabled ? "classic" : "blank";
+ ["classic", "blank"].forEach(id => {
let node = this._nodes[id];
if (id == selected) {
node.setAttribute("selected", true);
@@ -125,9 +120,5 @@ var gCustomize = {
node.removeAttribute("selected");
}
});
- if (selected == "enhanced") {
- // If enhanced is selected, so is classic (since enhanced is a subitem of classic)
- this._nodes.classic.setAttribute("selected", true);
- }
},
};
diff --git a/browser/base/content/newtab/newTab.xhtml b/browser/base/content/newtab/newTab.xhtml
index 07fb0093ed..eef51b4b24 100644
--- a/browser/base/content/newtab/newTab.xhtml
+++ b/browser/base/content/newtab/newTab.xhtml
@@ -33,15 +33,8 @@
<div id="newtab-customize-title" class="newtab-customize-panel-item">
<label>&newtab.customize.cog.title2;</label>
</div>
-
- <div class="newtab-customize-complex-option">
- <div id="newtab-customize-classic" class="newtab-customize-panel-superitem newtab-customize-panel-item selectable">
- <label>&newtab.customize.classic;</label>
- </div>
- <div id="newtab-customize-enhanced" class="newtab-customize-panel-subitem">
- <label class="checkbox"></label>
- <label>&newtab.customize.cog.enhanced;</label>
- </div>
+ <div id="newtab-customize-classic" class="newtab-customize-panel-item selectable">
+ <label>&newtab.customize.classic;</label>
</div>
<div id="newtab-customize-blank" class="newtab-customize-panel-item selectable">
<label>&newtab.customize.blank2;</label>
diff --git a/toolkit/modules/NewTabUtils.jsm b/toolkit/modules/NewTabUtils.jsm
index df8dae89d8..e452a6fb2e 100644
--- a/toolkit/modules/NewTabUtils.jsm
+++ b/toolkit/modules/NewTabUtils.jsm
@@ -249,10 +249,15 @@ var AllPages = {
* Returns whether the history tiles are enhanced.
*/
get enhanced() {
+#ifdef MC_BASILISK
+ // Hard-block the use of sponsored tiles.
+ return false;
+#else
if (this._enhanced === null)
this._enhanced = Services.prefs.getBoolPref(PREF_NEWTAB_ENHANCED);
return this._enhanced;
+#endif
},
/**
diff --git a/toolkit/modules/moz.build b/toolkit/modules/moz.build
index 2577412747..60f3cc3da4 100644
--- a/toolkit/modules/moz.build
+++ b/toolkit/modules/moz.build
@@ -57,7 +57,6 @@ EXTRA_JS_MODULES += [
'Locale.jsm',
'Log.jsm',
'Memory.jsm',
- 'NewTabUtils.jsm',
'NLP.jsm',
'ObjectUtils.jsm',
'PageMenu.jsm',
@@ -104,6 +103,8 @@ EXTRA_JS_MODULES += [
EXTRA_JS_MODULES.third_party.jsesc += ['third_party/jsesc/jsesc.js']
EXTRA_JS_MODULES.sessionstore += ['sessionstore/Utils.jsm']
+EXTRA_PP_JS_MODULES += ['NewTabUtils.jsm']
+
if not CONFIG['MOZ_WEBEXTENSIONS']:
EXTRA_PP_JS_MODULES += ['UpdateChannel.jsm']