diff options
author | Matt A. Tobin <email@mattatobin.com> | 2019-04-25 06:02:08 -0400 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2019-04-25 06:02:08 -0400 |
commit | cb5d20deb7fed28887b9ea8edfad7792e59c1679 (patch) | |
tree | e94fcce5ec77b7275c89d12454977325b0a0a2c0 | |
parent | 325b204d2661dafd2720d3e78f47be8038871dbd (diff) | |
download | UXP-cb5d20deb7fed28887b9ea8edfad7792e59c1679.tar UXP-cb5d20deb7fed28887b9ea8edfad7792e59c1679.tar.gz UXP-cb5d20deb7fed28887b9ea8edfad7792e59c1679.tar.lz UXP-cb5d20deb7fed28887b9ea8edfad7792e59c1679.tar.xz UXP-cb5d20deb7fed28887b9ea8edfad7792e59c1679.zip |
Add application ID and widget toolkit placeholders to UpdateUtils.jsm
-rw-r--r-- | toolkit/modules/UpdateUtils.jsm | 15 | ||||
-rw-r--r-- | toolkit/modules/moz.build | 2 |
2 files changed, 12 insertions, 5 deletions
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..ba71a5a3c 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', @@ -104,6 +103,7 @@ EXTRA_PP_JS_MODULES += [ 'NewTabUtils.jsm', 'Troubleshoot.jsm', 'UpdateChannel.jsm', + 'UpdateUtils.jsm', ] if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'cocoa'): |