Bug 1057966 - Fix Help menu in e10s windows. r=billm.
authorMike Conley <mconley@mozilla.com>
Fri, 29 Aug 2014 19:54:32 -0400
changeset 224239 5b89084d3dd65db7461998db03f554e614a59a79
parent 224238 47b9e8d327d927ff454ca6d1db5f1ddcb61144f6
child 224240 0239fbe8a0c8119fa37323c3143201a9e3d82ee1
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbillm
bugs1057966, 1051017
milestone34.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1057966 - Fix Help menu in e10s windows. r=billm. The help menu wasn't populating properly because gSafeBrowsing was attempting to get the URI for the loaded page by getting content.document.documentURI. Since bug 1051017 landed, content is unavailable for e10s windows. We use the selected browser's currentURI instead.
browser/base/content/browser-safebrowsing.js
--- a/browser/base/content/browser-safebrowsing.js
+++ b/browser/base/content/browser-safebrowsing.js
@@ -1,35 +1,34 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # 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/.
 
 #ifdef MOZ_SAFE_BROWSING
 var gSafeBrowsing = {
 
   setReportPhishingMenu: function() {
-
     // A phishing page will have a specific about:blocked content documentURI
-    var isPhishingPage = content.document.documentURI.startsWith("about:blocked?e=phishingBlocked");
+    var uri = getBrowser().currentURI;
+    var isPhishingPage = uri && uri.spec.startsWith("about:blocked?e=phishingBlocked");
 
     // Show/hide the appropriate menu item.
     document.getElementById("menu_HelpPopup_reportPhishingtoolmenu")
             .hidden = isPhishingPage;
     document.getElementById("menu_HelpPopup_reportPhishingErrortoolmenu")
             .hidden = !isPhishingPage;
 
     var broadcasterId = isPhishingPage
                         ? "reportPhishingErrorBroadcaster"
                         : "reportPhishingBroadcaster";
 
     var broadcaster = document.getElementById(broadcasterId);
     if (!broadcaster)
       return;
 
-    var uri = getBrowser().currentURI;
     if (uri && (uri.schemeIs("http") || uri.schemeIs("https")))
       broadcaster.removeAttribute("disabled");
     else
       broadcaster.setAttribute("disabled", true);
   },
 
   /**
    * Used to report a phishing page or a false positive