mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-22 07:07:30 +09:00
Add application ID and widget toolkit placeholders to UpdateUtils.jsm
This commit is contained in:
parent
97059c1b48
commit
3c98d8f72d
2 changed files with 12 additions and 8 deletions
|
|
@ -2,6 +2,8 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
#filter substitution
|
||||||
|
|
||||||
this.EXPORTED_SYMBOLS = ["UpdateUtils"];
|
this.EXPORTED_SYMBOLS = ["UpdateUtils"];
|
||||||
|
|
||||||
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
|
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
|
||||||
|
|
@ -65,23 +67,28 @@ this.UpdateUtils = {
|
||||||
* @return The formatted URL.
|
* @return The formatted URL.
|
||||||
*/
|
*/
|
||||||
formatUpdateURL(url) {
|
formatUpdateURL(url) {
|
||||||
|
url = url.replace(/%ID%/g, Services.appinfo.ID);
|
||||||
url = url.replace(/%PRODUCT%/g, Services.appinfo.name);
|
url = url.replace(/%PRODUCT%/g, Services.appinfo.name);
|
||||||
url = url.replace(/%VERSION%/g, Services.appinfo.version);
|
url = url.replace(/%VERSION%/g, Services.appinfo.version);
|
||||||
url = url.replace(/%BUILD_ID%/g, Services.appinfo.appBuildID);
|
url = url.replace(/%BUILD_ID%/g, Services.appinfo.appBuildID);
|
||||||
url = url.replace(/%BUILD_TARGET%/g, Services.appinfo.OS + "_" + this.ABI);
|
url = url.replace(/%BUILD_TARGET%/g, Services.appinfo.OS + "_" + this.ABI);
|
||||||
url = url.replace(/%OS_VERSION%/g, this.OSVersion);
|
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)) {
|
if (/%LOCALE%/.test(url)) {
|
||||||
url = url.replace(/%LOCALE%/g, this.Locale);
|
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(/%PLATFORM_VERSION%/g, Services.appinfo.platformVersion);
|
||||||
url = url.replace(/%DISTRIBUTION%/g,
|
url = url.replace(/%DISTRIBUTION%/g,
|
||||||
getDistributionPrefValue(PREF_APP_DISTRIBUTION));
|
getDistributionPrefValue(PREF_APP_DISTRIBUTION));
|
||||||
url = url.replace(/%DISTRIBUTION_VERSION%/g,
|
url = url.replace(/%DISTRIBUTION_VERSION%/g,
|
||||||
getDistributionPrefValue(PREF_APP_DISTRIBUTION_VERSION));
|
getDistributionPrefValue(PREF_APP_DISTRIBUTION_VERSION));
|
||||||
url = url.replace(/%CUSTOM%/g, Preferences.get(PREF_APP_UPDATE_CUSTOM, ""));
|
|
||||||
url = url.replace(/\+/g, "%2B");
|
|
||||||
|
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,6 @@ EXTRA_JS_MODULES += [
|
||||||
'Sqlite.jsm',
|
'Sqlite.jsm',
|
||||||
'Task.jsm',
|
'Task.jsm',
|
||||||
'Timer.jsm',
|
'Timer.jsm',
|
||||||
'UpdateUtils.jsm',
|
|
||||||
'WebChannel.jsm',
|
'WebChannel.jsm',
|
||||||
'WindowDraggingUtils.jsm',
|
'WindowDraggingUtils.jsm',
|
||||||
'ZipUtils.jsm',
|
'ZipUtils.jsm',
|
||||||
|
|
@ -103,11 +102,9 @@ EXTRA_JS_MODULES.sessionstore += ['sessionstore/Utils.jsm']
|
||||||
EXTRA_PP_JS_MODULES += [
|
EXTRA_PP_JS_MODULES += [
|
||||||
'NewTabUtils.jsm',
|
'NewTabUtils.jsm',
|
||||||
'Troubleshoot.jsm',
|
'Troubleshoot.jsm',
|
||||||
|
'UpdateUtils.jsm',
|
||||||
]
|
]
|
||||||
|
|
||||||
if not CONFIG['MOZ_WEBEXTENSIONS']:
|
|
||||||
EXTRA_PP_JS_MODULES += ['UpdateChannel.jsm']
|
|
||||||
|
|
||||||
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'cocoa'):
|
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'cocoa'):
|
||||||
DEFINES['CAN_DRAW_IN_TITLEBAR'] = 1
|
DEFINES['CAN_DRAW_IN_TITLEBAR'] = 1
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue