Bug 1429364 - Fix 'Save Link As' context menu option in sidebars. r=Gijs draft
authorPanos Astithas <past@mozilla.com>
Thu, 11 Jan 2018 16:03:41 -0800
changeset 719704 6eae197c940a0284c3a47d93bbd4ec9f60d7f1d5
parent 717738 6f5fac320fcb6625603fa8a744ffa8523f8b3d71
child 745885 58e03b3028e10bb0f05803e7c67a1649e14001ff
push id95351
push userbmo:past@mozilla.com
push dateFri, 12 Jan 2018 17:34:14 +0000
reviewersGijs
bugs1429364
milestone59.0a1
Bug 1429364 - Fix 'Save Link As' context menu option in sidebars. r=Gijs MozReview-Commit-ID: 2RaxPjx1Jz7
browser/base/content/nsContextMenu.js
--- a/browser/base/content/nsContextMenu.js
+++ b/browser/base/content/nsContextMenu.js
@@ -1151,17 +1151,17 @@ nsContextMenu.prototype = {
                     loadingPrincipal: this.principal,
                     contentPolicyType: Ci.nsIContentPolicy.TYPE_SAVEAS_DOWNLOAD,
                     securityFlags: Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_INHERITS,
                   });
 
     if (linkDownload)
       channel.contentDispositionFilename = linkDownload;
     if (channel instanceof Ci.nsIPrivateBrowsingChannel) {
-      let docIsPrivate = PrivateBrowsingUtils.isBrowserPrivate(gBrowser.selectedBrowser);
+      let docIsPrivate = PrivateBrowsingUtils.isBrowserPrivate(this.browser);
       channel.setPrivate(docIsPrivate);
     }
     channel.notificationCallbacks = new callbacks();
 
     let flags = Ci.nsIChannel.LOAD_CALL_CONTENT_SNIFFERS;
 
     if (bypassCache)
       flags |= Ci.nsIRequest.LOAD_BYPASS_CACHE;