Bug 1220160 - part 2: use mozDocumentURIIfNotForErrorPages for context menu's docLocation, r=MattN
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Fri, 19 Feb 2016 14:05:10 +0000
changeset 321621 2142620090e707b024adbfd5fcc77200a57836d8
parent 321618 9cf43731a81106da80a5ca3e3bd066d551666a9b
child 321622 e4be65c87fcc7d04b662f90af45ca6d2f17fa59a
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMattN
bugs1220160
milestone47.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 1220160 - part 2: use mozDocumentURIIfNotForErrorPages for context menu's docLocation, r=MattN MozReview-Commit-ID: 7hBFzeh5jpz
browser/base/content/content.js
--- a/browser/base/content/content.js
+++ b/browser/base/content/content.js
@@ -94,17 +94,17 @@ var handleContentContextMenu = function 
   let subject = {
     event: event,
     addonInfo: addonInfo,
   };
   subject.wrappedJSObject = subject;
   Services.obs.notifyObservers(subject, "content-contextmenu", null);
 
   let doc = event.target.ownerDocument;
-  let docLocation = doc.location ? doc.location.href : undefined;
+  let docLocation = doc.mozDocumentURIIfNotForErrorPages;
   let charSet = doc.characterSet;
   let baseURI = doc.baseURI;
   let referrer = doc.referrer;
   let referrerPolicy = doc.referrerPolicy;
   let frameOuterWindowID = doc.defaultView.QueryInterface(Ci.nsIInterfaceRequestor)
                                           .getInterface(Ci.nsIDOMWindowUtils)
                                           .outerWindowID;
   let loginFillInfo = LoginManagerContent.getFieldContext(event.target);
@@ -272,17 +272,16 @@ var AboutCertErrorListener = {
   onSetAutomatic(event) {
     sendAsyncMessage("Browser:SetSSLErrorReportAuto", {
       automatic: event.detail
     });
 
     // if we're enabling reports, send a report for this failure
     if (event.detail) {
       let doc = content.document;
-      let location = doc.location.href;
 
       let serhelper = Cc["@mozilla.org/network/serialization-helper;1"]
           .getService(Ci.nsISerializationHelper);
 
       let serializable =  docShell.failedChannel.securityInfo
           .QueryInterface(Ci.nsITransportSecurityInfo)
           .QueryInterface(Ci.nsISerializable);
 
@@ -346,18 +345,16 @@ var AboutNetErrorListener = {
     sendAsyncMessage("Browser:SetSSLErrorReportAuto", {
       automatic: evt.detail
     });
 
     // if we're enabling reports, send a report for this failure
     if (evt.detail) {
       let contentDoc = content.document;
 
-      let location = contentDoc.location.href;
-
       let serhelper = Cc["@mozilla.org/network/serialization-helper;1"]
                         .getService(Ci.nsISerializationHelper);
 
       let serializable = docShell.failedChannel.securityInfo
           .QueryInterface(Ci.nsITransportSecurityInfo)
           .QueryInterface(Ci.nsISerializable);
 
       let serializedSecurityInfo = serhelper.serializeToString(serializable);