summaryrefslogtreecommitdiffstats
path: root/toolkit/modules
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-06-29 22:58:52 +0200
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-06-29 22:58:52 +0200
commite09746b2f34ce69c7bc4c86b1f90f62b7c8d9c51 (patch)
treef8d4d2b62b2bcd2f5b37ce7cbf6fa873cff185b0 /toolkit/modules
parentbfb36627c66ff8a27da7c1bace60496352fd096b (diff)
parente4b2fa17baea1d35d80de19ffb90d9ba2a1033f8 (diff)
downloadUXP-e09746b2f34ce69c7bc4c86b1f90f62b7c8d9c51.tar
UXP-e09746b2f34ce69c7bc4c86b1f90f62b7c8d9c51.tar.gz
UXP-e09746b2f34ce69c7bc4c86b1f90f62b7c8d9c51.tar.lz
UXP-e09746b2f34ce69c7bc4c86b1f90f62b7c8d9c51.tar.xz
UXP-e09746b2f34ce69c7bc4c86b1f90f62b7c8d9c51.zip
Merge branch 'master' into Pale_Moon-release
# Conflicts: # application/palemoon/config/version.txt # security/manager/ssl/nsSTSPreloadList.errors # security/manager/ssl/nsSTSPreloadList.inc
Diffstat (limited to 'toolkit/modules')
-rw-r--r--toolkit/modules/NewTabUtils.jsm42
-rw-r--r--toolkit/modules/UpdateChannel.jsm47
-rw-r--r--toolkit/modules/UpdateUtils.jsm15
-rw-r--r--toolkit/modules/moz.build3
4 files changed, 13 insertions, 94 deletions
diff --git a/toolkit/modules/NewTabUtils.jsm b/toolkit/modules/NewTabUtils.jsm
index 35e38156f..500d08fa5 100644
--- a/toolkit/modules/NewTabUtils.jsm
+++ b/toolkit/modules/NewTabUtils.jsm
@@ -36,7 +36,6 @@ XPCOMUtils.defineLazyGetter(this, "gUnicodeConverter", function () {
// Boolean preferences that control newtab content
const PREF_NEWTAB_ENABLED = "browser.newtabpage.enabled";
-const PREF_NEWTAB_ENHANCED = "browser.newtabpage.enhanced";
// The preference that tells the number of rows of the newtab grid.
const PREF_NEWTAB_ROWS = "browser.newtabpage.rows";
@@ -200,11 +199,6 @@ var AllPages = {
_enabled: null,
/**
- * Cached value that tells whether the New Tab Page feature is enhanced.
- */
- _enhanced: null,
-
- /**
* Adds a page to the internal list of pages.
* @param aPage The page to register.
*/
@@ -242,29 +236,6 @@ var AllPages = {
},
/**
- * Returns whether the history tiles are enhanced.
- */
- get enhanced() {
-#if defined(MC_BASILISK) || defined(HYPE_ICEWEASEL)
- // 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
- },
-
- /**
- * Enables or disables the enhancement of history tiles feature.
- */
- set enhanced(aEnhanced) {
- if (this.enhanced != aEnhanced)
- Services.prefs.setBoolPref(PREF_NEWTAB_ENHANCED, !!aEnhanced);
- },
-
- /**
* Returns the number of registered New Tab Pages (i.e. the number of open
* about:newtab instances).
*/
@@ -296,9 +267,6 @@ var AllPages = {
case PREF_NEWTAB_ENABLED:
this._enabled = null;
break;
- case PREF_NEWTAB_ENHANCED:
- this._enhanced = null;
- break;
}
}
// and all notifications get forwarded to each page.
@@ -313,7 +281,6 @@ var AllPages = {
*/
_addObserver: function AllPages_addObserver() {
Services.prefs.addObserver(PREF_NEWTAB_ENABLED, this, true);
- Services.prefs.addObserver(PREF_NEWTAB_ENHANCED, this, true);
Services.obs.addObserver(this, "page-thumbnail:create", true);
this._addObserver = function () {};
},
@@ -480,8 +447,6 @@ var PinnedLinks = {
return false;
}
aLink.type = "history";
- // always remove targetedSite
- delete aLink.targetedSite;
return true;
},
@@ -1099,11 +1064,8 @@ var Links = {
_getMergedProviderLinks: function Links__getMergedProviderLinks() {
// Build a list containing a copy of each provider's sortedLinks list.
let linkLists = [];
+ let { console } = Cu.import("resource://gre/modules/Console.jsm", {});
for (let provider of this._providers.keys()) {
- if (!AllPages.enhanced && provider != PlacesProvider) {
- // Only show history tiles if we're not in 'enhanced' mode.
- continue;
- }
let links = this._providers.get(provider);
if (links && links.sortedLinks) {
linkLists.push(links.sortedLinks.slice());
@@ -1305,8 +1267,6 @@ var Telemetry = {
let probes = [
{ histogram: "NEWTAB_PAGE_ENABLED",
value: AllPages.enabled },
- { histogram: "NEWTAB_PAGE_ENHANCED",
- value: AllPages.enhanced },
{ histogram: "NEWTAB_PAGE_PINNED_SITES_COUNT",
value: PinnedLinks.links.length },
{ histogram: "NEWTAB_PAGE_BLOCKED_SITES_COUNT",
diff --git a/toolkit/modules/UpdateChannel.jsm b/toolkit/modules/UpdateChannel.jsm
deleted file mode 100644
index c2bdce8ad..000000000
--- a/toolkit/modules/UpdateChannel.jsm
+++ /dev/null
@@ -1,47 +0,0 @@
-#filter substitution
-
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-this.EXPORTED_SYMBOLS = ["UpdateChannel"];
-
-const Cu = Components.utils;
-
-Cu.import("resource://gre/modules/Services.jsm");
-
-this.UpdateChannel = {
- /**
- * Read the update channel from defaults only. We do this to ensure that
- * the channel is tightly coupled with the application and does not apply
- * to other instances of the application that may use the same profile.
- *
- * @param [optional] aIncludePartners
- * Whether or not to include the partner bits. Default: true.
- */
- get: function UpdateChannel_get(aIncludePartners = true) {
- let channel = "@MOZ_UPDATE_CHANNEL@";
- let defaults = Services.prefs.getDefaultBranch(null);
- try {
- channel = defaults.getCharPref("app.update.channel");
- } catch (e) {
- // use default value when pref not found
- }
-
- if (aIncludePartners) {
- try {
- let partners = Services.prefs.getChildList("app.partner.").sort();
- if (partners.length) {
- channel += "-cck";
- partners.forEach(function (prefName) {
- channel += "-" + Services.prefs.getCharPref(prefName);
- });
- }
- } catch (e) {
- Cu.reportError(e);
- }
- }
-
- return channel;
- }
-};
diff --git a/toolkit/modules/UpdateUtils.jsm b/toolkit/modules/UpdateUtils.jsm
index 4e796a2da..4c6e7776d 100644
--- a/toolkit/modules/UpdateUtils.jsm
+++ b/toolkit/modules/UpdateUtils.jsm
@@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+#filter substitution
+
this.EXPORTED_SYMBOLS = ["UpdateUtils"];
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
@@ -65,23 +67,28 @@ this.UpdateUtils = {
* @return The formatted URL.
*/
formatUpdateURL(url) {
+ url = url.replace(/%ID%/g, Services.appinfo.ID);
url = url.replace(/%PRODUCT%/g, Services.appinfo.name);
url = url.replace(/%VERSION%/g, Services.appinfo.version);
url = url.replace(/%BUILD_ID%/g, Services.appinfo.appBuildID);
url = url.replace(/%BUILD_TARGET%/g, Services.appinfo.OS + "_" + this.ABI);
url = url.replace(/%OS_VERSION%/g, this.OSVersion);
- url = url.replace(/%SYSTEM_CAPABILITIES%/g, gSystemCapabilities);
+ url = url.replace(/%WIDGET_TOOLKIT%/g, "@MOZ_WIDGET_TOOLKIT@");
+ url = url.replace(/%CHANNEL%/g, this.UpdateChannel);
+
if (/%LOCALE%/.test(url)) {
url = url.replace(/%LOCALE%/g, this.Locale);
}
- url = url.replace(/%CHANNEL%/g, this.UpdateChannel);
+
+ url = url.replace(/%CUSTOM%/g, Preferences.get(PREF_APP_UPDATE_CUSTOM, ""));
+ url = url.replace(/\+/g, "%2B");
+
+ url = url.replace(/%SYSTEM_CAPABILITIES%/g, gSystemCapabilities);
url = url.replace(/%PLATFORM_VERSION%/g, Services.appinfo.platformVersion);
url = url.replace(/%DISTRIBUTION%/g,
getDistributionPrefValue(PREF_APP_DISTRIBUTION));
url = url.replace(/%DISTRIBUTION_VERSION%/g,
getDistributionPrefValue(PREF_APP_DISTRIBUTION_VERSION));
- url = url.replace(/%CUSTOM%/g, Preferences.get(PREF_APP_UPDATE_CUSTOM, ""));
- url = url.replace(/\+/g, "%2B");
return url;
}
diff --git a/toolkit/modules/moz.build b/toolkit/modules/moz.build
index 8f66417c1..4e647bd7f 100644
--- a/toolkit/modules/moz.build
+++ b/toolkit/modules/moz.build
@@ -92,7 +92,6 @@ EXTRA_JS_MODULES += [
'Sqlite.jsm',
'Task.jsm',
'Timer.jsm',
- 'UpdateUtils.jsm',
'WebChannel.jsm',
'WindowDraggingUtils.jsm',
'ZipUtils.jsm',
@@ -103,7 +102,7 @@ EXTRA_JS_MODULES.sessionstore += ['sessionstore/Utils.jsm']
EXTRA_PP_JS_MODULES += [
'NewTabUtils.jsm',
'Troubleshoot.jsm',
- 'UpdateChannel.jsm',
+ 'UpdateUtils.jsm',
]
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'cocoa'):