diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index 35a9e83f530..73c617e71c0 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -757,6 +757,7 @@ pref("urlclassifier.max-complete-age", 2700); #endif pref("browser.geolocation.warning.infoURL", "http://www.mozilla.com/%LOCALE%/firefox/geolocation/"); +pref("browser.mixedcontent.warning.infoURL", "http://support.mozilla.org/1/%APP%/%VERSION%/%OS%/%LOCALE%/mixed-content/"); pref("browser.EULA.version", 3); pref("browser.rights.version", 3); diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 1dea8f5699c..659b3d17b13 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -6648,7 +6648,7 @@ var gIdentityHandler = { } else if (state & nsIWebProgressListener.STATE_IS_SECURE) { this.setMode(this.IDENTITY_MODE_DOMAIN_VERIFIED); } else if (state & nsIWebProgressListener.STATE_IS_BROKEN) { - if (gBrowser.docShell.hasMixedActiveContentLoaded) { + if (state & nsIWebProgressListener.STATE_LOADED_MIXED_ACTIVE_CONTENT) { this.setMode(this.IDENTITY_MODE_MIXED_ACTIVE_CONTENT); } else { this.setMode(this.IDENTITY_MODE_MIXED_CONTENT); @@ -6656,6 +6656,48 @@ var gIdentityHandler = { } else { this.setMode(this.IDENTITY_MODE_UNKNOWN); } + + // Ensure the doorhanger is shown when mixed active content is blocked. + if (state & nsIWebProgressListener.STATE_BLOCKED_MIXED_ACTIVE_CONTENT) + this.showMixedContentDoorhanger(); + }, + + /** + * Display the Mixed Content Blocker doohanger, providing an option + * to the user to override mixed content blocking + */ + showMixedContentDoorhanger : function() { + // If we've already got an active notification, bail out to avoid showing it repeatedly. + if (PopupNotifications.getNotification("mixed-content-blocked", gBrowser.selectedBrowser)) + return; + + let helplink = document.getElementById("mixed-content-blocked-helplink"); + helplink.href = Services.urlFormatter.formatURLPref("browser.mixedcontent.warning.infoURL"); + + let brandBundle = document.getElementById("bundle_brand"); + let brandShortName = brandBundle.getString("brandShortName"); + let messageString = gNavigatorBundle.getFormattedString("mixedContentBlocked.message", [brandShortName]); + let action = { + label: gNavigatorBundle.getString("mixedContentBlocked.keepBlockingButton.label"), + accessKey: gNavigatorBundle.getString("mixedContentBlocked.keepBlockingButton.accesskey"), + callback: function() { /* NOP */ } + }; + let secondaryActions = [ + { + label: gNavigatorBundle.getString("mixedContentBlocked.unblock.label"), + accessKey: gNavigatorBundle.getString("mixedContentBlocked.unblock.accesskey"), + callback: function() { + // Reload the page with the content unblocked + BrowserReloadWithFlags(nsIWebNavigation.LOAD_FLAGS_ALLOW_MIXED_CONTENT); + } + } + ]; + let options = { + dismissed: true, + }; + PopupNotifications.show(gBrowser.selectedBrowser, "mixed-content-blocked", + messageString, "mixed-content-blocked-notification-icon", + action, secondaryActions, options); }, /** diff --git a/browser/base/content/browser.xul b/browser/base/content/browser.xul index f6d4cca730c..8ba9fc9dd71 100644 --- a/browser/base/content/browser.xul +++ b/browser/base/content/browser.xul @@ -473,6 +473,17 @@