Bug 1147911 Part 1: Fix call to _openURIInNewTab in browser.js to take a URI referrer not a string. r=gijs
authorBob Owen <bobowencode@gmail.com>
Thu, 24 Nov 2016 15:08:30 +0000
changeset 324217 19e3bf665a8e
parent 324216 49228a69b071
child 324218 9245c2950d55
push id30993
push usercbook@mozilla.com
push date2016-11-25 14:40 +0000
treeherdermozilla-central@b982373cb0e9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgijs
bugs1147911
milestone53.0a1
Bug 1147911 Part 1: Fix call to _openURIInNewTab in browser.js to take a URI referrer not a string. r=gijs
browser/base/content/browser.js
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -5020,17 +5020,18 @@ nsBrowserAccess.prototype = {
 
     var isExternal = !!(aFlags & Ci.nsIBrowserDOMWindow.OPEN_EXTERNAL);
 
     var userContextId = aParams.openerOriginAttributes &&
                         ("userContextId" in aParams.openerOriginAttributes)
                           ? aParams.openerOriginAttributes.userContextId
                           : Ci.nsIScriptSecurityManager.DEFAULT_USER_CONTEXT_ID
 
-    let browser = this._openURIInNewTab(aURI, aParams.referrer,
+    let referrer = aParams.referrer ? makeURI(aParams.referrer) : null;
+    let browser = this._openURIInNewTab(aURI, referrer,
                                         aParams.referrerPolicy,
                                         aParams.isPrivate,
                                         isExternal, false,
                                         userContextId);
     if (browser)
       return browser.QueryInterface(Ci.nsIFrameLoaderOwner);
 
     return null;