diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-13 08:15:49 +0200 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-13 08:15:49 +0200 |
commit | c2d77decb2e041430221adf59c14eefa1b22d3c2 (patch) | |
tree | 50cd414d3fd20deda6e56a082b40489f8989c563 /application/palemoon/base/content/nsContextMenu.js | |
parent | e226e36a6c1792b68ba22a2ae43b8e1e230b5246 (diff) | |
download | UXP-c2d77decb2e041430221adf59c14eefa1b22d3c2.tar UXP-c2d77decb2e041430221adf59c14eefa1b22d3c2.tar.gz UXP-c2d77decb2e041430221adf59c14eefa1b22d3c2.tar.lz UXP-c2d77decb2e041430221adf59c14eefa1b22d3c2.tar.xz UXP-c2d77decb2e041430221adf59c14eefa1b22d3c2.zip |
Fix: DEPRECATION WARNING: saveImageURL should be passed the private state of the in nsContextMenu.js
Issue #121
Diffstat (limited to 'application/palemoon/base/content/nsContextMenu.js')
-rw-r--r-- | application/palemoon/base/content/nsContextMenu.js | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/application/palemoon/base/content/nsContextMenu.js b/application/palemoon/base/content/nsContextMenu.js index f914f5841..17db4d3a9 100644 --- a/application/palemoon/base/content/nsContextMenu.js +++ b/application/palemoon/base/content/nsContextMenu.js @@ -911,6 +911,9 @@ nsContextMenu.prototype = { }, saveVideoFrameAsImage: function () { + let referrerURI = document.documentURIObject; + let isPrivate = PrivateBrowsingUtils.isBrowserPrivate(this.browser); + urlSecurityCheck(this.mediaURL, this.browser.contentPrincipal, Ci.nsIScriptSecurityManager.DISALLOW_SCRIPT); let name = ""; @@ -928,7 +931,9 @@ nsContextMenu.prototype = { canvas.height = video.videoHeight; var ctxDraw = canvas.getContext("2d"); ctxDraw.drawImage(video, 0, 0); - saveImageURL(canvas.toDataURL("image/jpeg", ""), name, "SaveImageTitle", true, false, document.documentURIObject, this.target.ownerDocument); + saveImageURL(canvas.toDataURL("image/jpeg", ""), name, "SaveImageTitle", + true, false, referrerURI, + null, null, null, isPrivate); }, fullScreenVideo: function () { @@ -1179,6 +1184,8 @@ nsContextMenu.prototype = { // Save URL of the clicked upon image, video, or audio. saveMedia: function() { var doc = this.target.ownerDocument; + let referrerURI = doc.documentURIObject; + let isPrivate = PrivateBrowsingUtils.isBrowserPrivate(this.browser); if (this.onCanvas) { // Bypass cache, since it's a blob: URL. var target = this.target; @@ -1194,14 +1201,16 @@ nsContextMenu.prototype = { resolve(win.URL.createObjectURL(blob)); }) }}).then(function (blobURL) { - saveImageURL(blobURL, "canvas.png", "SaveImageTitle", true, - false, doc.documentURIObject, doc); + saveImageURL(blobURL, "canvas.png", "SaveImageTitle", + true, false, referrerURI, null, null, null, + isPrivate); }, Components.utils.reportError); } } else if (this.onImage) { urlSecurityCheck(this.mediaURL, doc.nodePrincipal); - saveImageURL(this.mediaURL, null, "SaveImageTitle", false, - false, doc.documentURIObject, doc); + saveImageURL(this.mediaURL, null, "SaveImageTitle", + false, false, referrerURI, doc, null, null, + isPrivate); } else if (this.onVideo || this.onAudio) { urlSecurityCheck(this.mediaURL, doc.nodePrincipal); var dialogTitle = this.onVideo ? "SaveVideoTitle" : "SaveAudioTitle"; |