diff options
Diffstat (limited to 'toolkit')
18 files changed, 127 insertions, 73 deletions
diff --git a/toolkit/locales/en-US/chrome/mozapps/extensions/extensions.properties b/toolkit/locales/en-US/chrome/mozapps/extensions/extensions.properties index 370198f56..5e64e938a 100644 --- a/toolkit/locales/en-US/chrome/mozapps/extensions/extensions.properties +++ b/toolkit/locales/en-US/chrome/mozapps/extensions/extensions.properties @@ -30,6 +30,8 @@ notification.blocked.link=More Information #LOCALIZATION NOTE (notification.softblocked) %1$S is the add-on name notification.softblocked=%1$S is known to cause issues. notification.softblocked.link=More Information +#LOCALIZATION NOTE (details.notification.compatibility) %1$S is the add-on name, %2$S is brand name +notification.compatibility=%1$S was not designed for %2$S. #LOCALIZATION NOTE (notification.outdated) %1$S is the add-on name notification.outdated=An important update is available for %1$S. notification.outdated.link=Update Now @@ -78,6 +80,8 @@ details.notification.incompatible=%1$S is incompatible with %2$S %3$S. #LOCALIZATION NOTE (details.notification.blocked) %1$S is the add-on name details.notification.blocked=%1$S has been disabled due to security or stability issues. details.notification.blocked.link=More Information +#LOCALIZATION NOTE (details.notification.compatibility) %1$S is the add-on name, %2$S is brand name +details.notification.compatibility=%1$S was not designed for %2$S. It may not function properly or cease to function. #LOCALIZATION NOTE (details.notification.softblocked) %1$S is the add-on name details.notification.softblocked=%1$S is known to cause issues. details.notification.softblocked.link=More Information diff --git a/toolkit/mozapps/downloads/nsHelperAppDlg.js b/toolkit/mozapps/downloads/nsHelperAppDlg.js index 243db1c2f..90d38c90b 100644 --- a/toolkit/mozapps/downloads/nsHelperAppDlg.js +++ b/toolkit/mozapps/downloads/nsHelperAppDlg.js @@ -638,6 +638,7 @@ nsUnknownContentTypeDialog.prototype = { // Returns true if opening the default application makes sense. openWithDefaultOK: function() { + // The checking is different on Windows... #ifdef XP_WIN // Windows presents some special cases. // We need to prevent use of "system default" when the file is @@ -675,7 +676,7 @@ nsUnknownContentTypeDialog.prototype = { // getPath: getPath: function (aFile) { #ifdef XP_MACOSX - return aFile.leafName || aFile.path; + return aFile.leafName || aFile.path; #else return aFile.path; #endif @@ -1007,11 +1008,13 @@ nsUnknownContentTypeDialog.prototype = { var otherHandler = this.dialogElement("otherHandler"); otherHandler.removeAttribute("hidden"); otherHandler.setAttribute("path", this.getPath(this.chosenApp.executable)); + #ifdef XP_WIN otherHandler.label = this.getFileDisplayName(this.chosenApp.executable); #else otherHandler.label = this.chosenApp.name; #endif + this.dialogElement("openHandler").selectedIndex = 1; this.dialogElement("openHandler").setAttribute("lastSelectedItemID", "otherHandler"); @@ -1069,43 +1072,42 @@ nsUnknownContentTypeDialog.prototype = { // Remember the file they chose to run. this.chosenApp = params.handlerApp; } -#else +#else // XP_WIN #if MOZ_WIDGET_GTK == 3 - var nsIApplicationChooser = Components.interfaces.nsIApplicationChooser; - var appChooser = Components.classes["@mozilla.org/applicationchooser;1"] - .createInstance(nsIApplicationChooser); - appChooser.init(this.mDialog, this.dialogElement("strings").getString("chooseAppFilePickerTitle")); - var contentTypeDialogObj = this; - let appChooserCallback = function appChooserCallback_done(aResult) { - if (aResult) { - contentTypeDialogObj.chosenApp = aResult.QueryInterface(Components.interfaces.nsILocalHandlerApp); - } - contentTypeDialogObj.finishChooseApp(); - }; - appChooser.open(this.mLauncher.MIMEInfo.MIMEType, appChooserCallback); - // The finishChooseApp is called from appChooserCallback - return; -#else - var nsIFilePicker = Components.interfaces.nsIFilePicker; - var fp = Components.classes["@mozilla.org/filepicker;1"] - .createInstance(nsIFilePicker); - fp.init(this.mDialog, - this.dialogElement("strings").getString("chooseAppFilePickerTitle"), - nsIFilePicker.modeOpen); - - fp.appendFilters(nsIFilePicker.filterApps); - - if (fp.show() == nsIFilePicker.returnOK && fp.file) { - // Remember the file they chose to run. - var localHandlerApp = - Components.classes["@mozilla.org/uriloader/local-handler-app;1"]. - createInstance(Components.interfaces.nsILocalHandlerApp); - localHandlerApp.executable = fp.file; - this.chosenApp = localHandlerApp; + var nsIApplicationChooser = Components.interfaces.nsIApplicationChooser; + var appChooser = Components.classes["@mozilla.org/applicationchooser;1"] + .createInstance(nsIApplicationChooser); + appChooser.init(this.mDialog, this.dialogElement("strings").getString("chooseAppFilePickerTitle")); + var contentTypeDialogObj = this; + let appChooserCallback = function appChooserCallback_done(aResult) { + if (aResult) { + contentTypeDialogObj.chosenApp = aResult.QueryInterface(Components.interfaces.nsILocalHandlerApp); } + contentTypeDialogObj.finishChooseApp(); + }; + appChooser.open(this.mLauncher.MIMEInfo.MIMEType, appChooserCallback); + // The finishChooseApp is called from appChooserCallback + return; +#else // MOZ_WIDGET_GTK == 3 + var nsIFilePicker = Components.interfaces.nsIFilePicker; + var fp = Components.classes["@mozilla.org/filepicker;1"] + .createInstance(nsIFilePicker); + fp.init(this.mDialog, + this.dialogElement("strings").getString("chooseAppFilePickerTitle"), + nsIFilePicker.modeOpen); + + fp.appendFilters(nsIFilePicker.filterApps); + + if (fp.show() == nsIFilePicker.returnOK && fp.file) { + // Remember the file they chose to run. + var localHandlerApp = + Components.classes["@mozilla.org/uriloader/local-handler-app;1"]. + createInstance(Components.interfaces.nsILocalHandlerApp); + localHandlerApp.executable = fp.file; + this.chosenApp = localHandlerApp; + } #endif // MOZ_WIDGET_GTK == 3 #endif // XP_WIN - } this.finishChooseApp(); }, diff --git a/toolkit/mozapps/extensions/content/extensions.js b/toolkit/mozapps/extensions/content/extensions.js index 9576e9a3b..782fca303 100644 --- a/toolkit/mozapps/extensions/content/extensions.js +++ b/toolkit/mozapps/extensions/content/extensions.js @@ -3059,6 +3059,15 @@ var gDetailView = { warning.textContent = gStrings.ext.formatStringFromName("details.notification.gmpPending", [this._addon.name], 1); +#ifdef MOZ_PHOENIX_EXTENSIONS + } else if (this._addon.native == false) { + this.node.setAttribute("notification", "warning"); + this.node.setAttribute("native", "false"); + document.getElementById("detail-warning").textContent = gStrings.ext.formatStringFromName( + "details.notification.compatibility", + [this._addon.name, gStrings.brandShortName], 2 + ); +#endif } else { this.node.removeAttribute("notification"); } diff --git a/toolkit/mozapps/extensions/content/extensions.xml b/toolkit/mozapps/extensions/content/extensions.xml index 9c8fda8ed..513807e78 100644 --- a/toolkit/mozapps/extensions/content/extensions.xml +++ b/toolkit/mozapps/extensions/content/extensions.xml @@ -858,8 +858,8 @@ xbl:inherits="value=name,tooltiptext=name"/> <xul:label anonid="version" class="version"/> #ifdef MOZ_PHOENIX_EXTENSIONS - <xul:label class="nativeIndicator nativeAddon" value="●" tooltiptext="&addon.nativeAddon;"/> - <xul:label class="nativeIndicator compatAddon" value="●" tooltiptext="&addon.compatAddon;"/> + <xul:label class="nativeIndicator nativeAddon" value="" tooltiptext="&addon.nativeAddon;"/> + <xul:label class="nativeIndicator compatAddon" value="⚠️" tooltiptext="&addon.compatAddon;"/> #endif <xul:label class="disabled-postfix" value="&addon.disabled.postfix;"/> <xul:label class="update-postfix" value="&addon.update.postfix;"/> @@ -1359,8 +1359,16 @@ } else { this.removeAttribute("notification"); #ifdef MOZ_PHOENIX_EXTENSIONS - if (this.mAddon.type == "extension") + if (this.mAddon.type == "extension") { this.setAttribute("native", this.mAddon.native); + if (this.mAddon.native == false) { + this.setAttribute("notification", "warning"); + this._warning.textContent = gStrings.ext.formatStringFromName( + "notification.compatibility", + [this.mAddon.name, gStrings.brandShortName], 2 + ); + } + } #endif } } diff --git a/toolkit/mozapps/extensions/internal/XPIProvider.jsm b/toolkit/mozapps/extensions/internal/XPIProvider.jsm index 600ec2ff5..2f298a934 100644 --- a/toolkit/mozapps/extensions/internal/XPIProvider.jsm +++ b/toolkit/mozapps/extensions/internal/XPIProvider.jsm @@ -6472,8 +6472,8 @@ AddonInternal.prototype = { } else if (app.id == FIREFOX_ID) { version = FIREFOX_APPCOMPATVERSION; - if (this.type == "locale") - //Never allow language packs in Firefox compatibility mode + if (this.type != "extension") + //Only allow extensions in Firefox compatibility mode return false; #endif } diff --git a/toolkit/themes/linux/mozapps/extensions/extensions.css b/toolkit/themes/linux/mozapps/extensions/extensions.css index 5c642fbbf..b21a65520 100644 --- a/toolkit/themes/linux/mozapps/extensions/extensions.css +++ b/toolkit/themes/linux/mozapps/extensions/extensions.css @@ -517,6 +517,13 @@ background-repeat: repeat-x; } +.addon-view[notification="warning"][native="false"] { + background-image: url("chrome://mozapps/skin/extensions/stripes-compatibility.png"), + linear-gradient(rgba(255, 128, 0, 0.04), + rgba(255, 128, 0, 0)); + background-repeat: repeat-x; +} + .addon-view[notification="error"] { background-image: url("chrome://mozapps/skin/extensions/stripes-error.png"), linear-gradient(rgba(255, 0, 0, 0.04), diff --git a/toolkit/themes/linux/mozapps/extensions/stripes-compatibility.png b/toolkit/themes/linux/mozapps/extensions/stripes-compatibility.png Binary files differnew file mode 100644 index 000000000..dee75516b --- /dev/null +++ b/toolkit/themes/linux/mozapps/extensions/stripes-compatibility.png diff --git a/toolkit/themes/linux/mozapps/extensions/stripes-error.png b/toolkit/themes/linux/mozapps/extensions/stripes-error.png Binary files differnew file mode 100644 index 000000000..1dc2d8504 --- /dev/null +++ b/toolkit/themes/linux/mozapps/extensions/stripes-error.png diff --git a/toolkit/themes/linux/mozapps/extensions/stripes-info-negative.png b/toolkit/themes/linux/mozapps/extensions/stripes-info-negative.png Binary files differnew file mode 100644 index 000000000..901ab1ec2 --- /dev/null +++ b/toolkit/themes/linux/mozapps/extensions/stripes-info-negative.png diff --git a/toolkit/themes/linux/mozapps/extensions/stripes-info-positive.png b/toolkit/themes/linux/mozapps/extensions/stripes-info-positive.png Binary files differnew file mode 100644 index 000000000..370ceec0f --- /dev/null +++ b/toolkit/themes/linux/mozapps/extensions/stripes-info-positive.png diff --git a/toolkit/themes/linux/mozapps/extensions/stripes-warning.png b/toolkit/themes/linux/mozapps/extensions/stripes-warning.png Binary files differnew file mode 100644 index 000000000..69463fb1a --- /dev/null +++ b/toolkit/themes/linux/mozapps/extensions/stripes-warning.png diff --git a/toolkit/themes/linux/mozapps/jar.mn b/toolkit/themes/linux/mozapps/jar.mn index 0931d1823..27b647308 100644 --- a/toolkit/themes/linux/mozapps/jar.mn +++ b/toolkit/themes/linux/mozapps/jar.mn @@ -26,6 +26,11 @@ toolkit.jar: skin/classic/mozapps/extensions/themeGeneric.png (extensions/themeGeneric.png) skin/classic/mozapps/extensions/themeGeneric-16.png (extensions/themeGeneric-16.png) skin/classic/mozapps/extensions/localeGeneric.png (extensions/localeGeneric.png) + skin/classic/mozapps/extensions/stripes-warning.png (extensions/stripes-warning.png) + skin/classic/mozapps/extensions/stripes-compatibility.png (extensions/stripes-compatibility.png) + skin/classic/mozapps/extensions/stripes-error.png (extensions/stripes-error.png) + skin/classic/mozapps/extensions/stripes-info-positive.png (extensions/stripes-info-positive.png) + skin/classic/mozapps/extensions/stripes-info-negative.png (extensions/stripes-info-negative.png) skin/classic/mozapps/extensions/newaddon.css (extensions/newaddon.css) skin/classic/mozapps/extensions/selectAddons.css (extensions/selectAddons.css) skin/classic/mozapps/xpinstall/xpinstallItemGeneric.png (extensions/extensionGeneric.png) diff --git a/toolkit/themes/osx/mozapps/extensions/extensions.css b/toolkit/themes/osx/mozapps/extensions/extensions.css index 9614967a4..474cb12d1 100644 --- a/toolkit/themes/osx/mozapps/extensions/extensions.css +++ b/toolkit/themes/osx/mozapps/extensions/extensions.css @@ -659,6 +659,13 @@ background-repeat: repeat-x; } +.addon-view[notification="warning"][native="false"] { + background-image: url("chrome://mozapps/skin/extensions/stripes-compatibility.png"), + linear-gradient(rgba(255, 128, 0, 0.04), + rgba(255, 128, 0, 0)); + background-repeat: repeat-x; +} + .addon-view[notification="error"] { background-image: url("chrome://mozapps/skin/extensions/stripes-error.png"), linear-gradient(rgba(255, 0, 0, 0.04), diff --git a/toolkit/themes/osx/mozapps/extensions/stripes-compatibility.png b/toolkit/themes/osx/mozapps/extensions/stripes-compatibility.png Binary files differnew file mode 100644 index 000000000..dee75516b --- /dev/null +++ b/toolkit/themes/osx/mozapps/extensions/stripes-compatibility.png diff --git a/toolkit/themes/windows/mozapps/extensions/extensions.css b/toolkit/themes/windows/mozapps/extensions/extensions.css index f350f7ca6..96ea1b46c 100644 --- a/toolkit/themes/windows/mozapps/extensions/extensions.css +++ b/toolkit/themes/windows/mozapps/extensions/extensions.css @@ -648,6 +648,13 @@ background-repeat: repeat-x; } +.addon-view[notification="warning"][native="false"] { + background-image: url("chrome://mozapps/skin/extensions/stripes-compatibility.png"), + linear-gradient(rgba(255, 128, 0, 0.04), + rgba(255, 128, 0, 0)); + background-repeat: repeat-x; +} + .addon-view[notification="error"] { background-image: url("chrome://mozapps/skin/extensions/stripes-error.png"), linear-gradient(rgba(255, 0, 0, 0.04), diff --git a/toolkit/themes/windows/mozapps/extensions/stripes-compatibility.png b/toolkit/themes/windows/mozapps/extensions/stripes-compatibility.png Binary files differnew file mode 100644 index 000000000..dee75516b --- /dev/null +++ b/toolkit/themes/windows/mozapps/extensions/stripes-compatibility.png diff --git a/toolkit/themes/windows/mozapps/jar.mn b/toolkit/themes/windows/mozapps/jar.mn index 9f7562995..5ca886051 100644 --- a/toolkit/themes/windows/mozapps/jar.mn +++ b/toolkit/themes/windows/mozapps/jar.mn @@ -39,6 +39,7 @@ toolkit.jar: skin/classic/mozapps/extensions/heart.png (extensions/heart.png) skin/classic/mozapps/extensions/navigation.png (extensions/navigation.png) skin/classic/mozapps/extensions/stripes-warning.png (extensions/stripes-warning.png) + skin/classic/mozapps/extensions/stripes-compatibility.png (extensions/stripes-compatibility.png) skin/classic/mozapps/extensions/stripes-error.png (extensions/stripes-error.png) skin/classic/mozapps/extensions/stripes-info-positive.png (extensions/stripes-info-positive.png) skin/classic/mozapps/extensions/stripes-info-negative.png (extensions/stripes-info-negative.png) diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp index b27e46697..d8f95c2a8 100644 --- a/toolkit/xre/nsAppRunner.cpp +++ b/toolkit/xre/nsAppRunner.cpp @@ -4131,45 +4131,49 @@ XRE_InitCommandLine(int aArgc, char* aArgv[]) delete[] canonArgs; #endif - const char *path = nullptr; - ArgResult ar = CheckArg("greomni", true, &path); - if (ar == ARG_BAD) { - PR_fprintf(PR_STDERR, - "Error: argument --greomni requires a path argument or the " - "--osint argument was specified with the --greomni argument " - "which is invalid.\n"); - return NS_ERROR_FAILURE; - } + if (PR_GetEnv("UXP_CUSTOM_OMNI")) { + // Process CLI parameters for specifying custom omnijars + const char *path = nullptr; + ArgResult ar = CheckArg("greomni", true, &path); + if (ar == ARG_BAD) { + PR_fprintf(PR_STDERR, + "Error: argument --greomni requires a path argument or the " + "--osint argument was specified with the --greomni argument " + "which is invalid.\n"); + return NS_ERROR_FAILURE; + } - if (!path) - return rv; + if (!path) + return rv; - nsCOMPtr<nsIFile> greOmni; - rv = XRE_GetFileFromPath(path, getter_AddRefs(greOmni)); - if (NS_FAILED(rv)) { - PR_fprintf(PR_STDERR, "Error: argument --greomni requires a valid path\n"); - return rv; - } + nsCOMPtr<nsIFile> greOmni; + rv = XRE_GetFileFromPath(path, getter_AddRefs(greOmni)); + if (NS_FAILED(rv)) { + PR_fprintf(PR_STDERR, "Error: argument --greomni requires a valid path\n"); + return rv; + } - ar = CheckArg("appomni", true, &path); - if (ar == ARG_BAD) { - PR_fprintf(PR_STDERR, - "Error: argument --appomni requires a path argument or the " - "--osint argument was specified with the --appomni argument " - "which is invalid.\n"); - return NS_ERROR_FAILURE; - } + ar = CheckArg("appomni", true, &path); + if (ar == ARG_BAD) { + PR_fprintf(PR_STDERR, + "Error: argument --appomni requires a path argument or the " + "--osint argument was specified with the --appomni argument " + "which is invalid.\n"); + return NS_ERROR_FAILURE; + } - nsCOMPtr<nsIFile> appOmni; - if (path) { - rv = XRE_GetFileFromPath(path, getter_AddRefs(appOmni)); - if (NS_FAILED(rv)) { - PR_fprintf(PR_STDERR, "Error: argument --appomni requires a valid path\n"); - return rv; - } - } + nsCOMPtr<nsIFile> appOmni; + if (path) { + rv = XRE_GetFileFromPath(path, getter_AddRefs(appOmni)); + if (NS_FAILED(rv)) { + PR_fprintf(PR_STDERR, "Error: argument --appomni requires a valid path\n"); + return rv; + } + } + + mozilla::Omnijar::Init(greOmni, appOmni); + } // UXP_CUSTOM_OMNI - mozilla::Omnijar::Init(greOmni, appOmni); return rv; } |