diff --git a/xpfe/components/prefwindow/resources/content/pref-applications-edit.xul b/xpfe/components/prefwindow/resources/content/pref-applications-edit.xul
index c601765362f1..1d2935528727 100644
--- a/xpfe/components/prefwindow/resources/content/pref-applications-edit.xul
+++ b/xpfe/components/prefwindow/resources/content/pref-applications-edit.xul
@@ -37,6 +37,7 @@
+
@@ -295,6 +296,35 @@
}
getDS();
gMIMEField.value = gMIMEField.value.toLowerCase();
+ // Get the promptservice, we will need it
+ var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService);
+ // Check if Mozilla can handle this type internally, in which case
+ // an entry would have no effect
+ try {
+ var categoryManager = Components.classes["@mozilla.org/categorymanager;1"]
+ .getService(Components.interfaces.nsICategoryManager);
+ if (categoryManager.getCategoryEntry("Gecko-Content-Viewers", gMIMEField.value)) {
+ var brandBundle = document.getElementById("bundle_Brand");
+ var text = gPrefApplicationsBundle.getString("canHandleInternally");
+ text = text.replace(/%brand%/g, brandBundle.getString("brandShortName"));
+ if (promptService.confirmEx(
+ window,
+ gPrefApplicationsBundle.getString("canHandleInternallyTitle"),
+ text,
+ (Components.interfaces.nsIPromptService.BUTTON_POS_1 *
+ Components.interfaces.nsIPromptService.BUTTON_TITLE_IS_STRING) |
+ (Components.interfaces.nsIPromptService.BUTTON_POS_0 *
+ Components.interfaces.nsIPromptService.BUTTON_TITLE_CANCEL),
+ null,
+ gPrefApplicationsBundle.getString("canHandleInternallyContinue"),
+ null,
+ null,
+ {}
+ ) == 0)
+ return false;
+ }
+ }
+ catch (ex) {}
// figure out if this mime type already exists.
if (gMIMEField.value != gOldMIME) {
var exists = mimeHandlerExists(gMIMEField.value);
@@ -302,7 +332,6 @@
var titleMsg = gPrefApplicationsBundle.getString("handlerExistsTitle");
var dialogMsg = gPrefApplicationsBundle.getString("handlerExists");
dialogMsg = dialogMsg.replace(/%mime%/g, gMIMEField.value);
- var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService);
var replace = promptService.confirm(window, titleMsg, dialogMsg);
if (!replace)
window.close();
diff --git a/xpfe/components/prefwindow/resources/locale/en-US/pref-applications.properties b/xpfe/components/prefwindow/resources/locale/en-US/pref-applications.properties
index 23fa5e6b8cd4..567a015f4167 100644
--- a/xpfe/components/prefwindow/resources/locale/en-US/pref-applications.properties
+++ b/xpfe/components/prefwindow/resources/locale/en-US/pref-applications.properties
@@ -8,6 +8,10 @@ handleInternally=Display files of this type in the browser
chooseHandler=Choose Helper Application
programsFilter=Programs
+canHandleInternallyTitle=Warning
+canHandleInternally=%brand% can handle this type internally. For such types, a Helper Application will only be invoked if the server requests external handling.
+canHandleInternallyContinue=&Proceed anyway
+
handlerExists=A helper already exists for the MIME type '%mime%'. Do you want to replace it?
handlerExistsTitle=Helper Application Exists