Bug 1343279 - Use SystemPrincipal when loading canvasToBlobURL. r=gijs a=jcristau
authorChristoph Kerschbaumer <ckerschb@christophkerschbaumer.com>
Tue, 28 Feb 2017 20:48:42 +0100
changeset 379049 5d47ea9e922d9cb2f2f289fab56231cad6a0f71b
parent 379048 7db4d272a316f60f6d0b8c1ede436035c1acefef
child 379050 fd0708b8461b5bf331f0335876920d8d3f833976
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgijs, jcristau
bugs1343279
milestone53.0
Bug 1343279 - Use SystemPrincipal when loading canvasToBlobURL. r=gijs a=jcristau
browser/base/content/nsContextMenu.js
--- a/browser/base/content/nsContextMenu.js
+++ b/browser/base/content/nsContextMenu.js
@@ -1125,20 +1125,22 @@ nsContextMenu.prototype = {
       };
       mm.addMessageListener("ContextMenu:Canvas:ToBlobURL:Result", onMessage);
     });
   },
 
   // Change current window to the URL of the image, video, or audio.
   viewMedia: function(e) {
     let referrerURI = gContextMenuContentData.documentURIObject;
+    let systemPrincipal = Services.scriptSecurityManager.getSystemPrincipal();
     if (this.onCanvas) {
       this._canvasToBlobURL(this.target).then(function(blobURL) {
         openUILink(blobURL, e, { disallowInheritPrincipal: true,
-                                 referrerURI: referrerURI });
+                                 referrerURI: referrerURI,
+                                 originPrincipal: systemPrincipal});
       }, Cu.reportError);
     }
     else {
       urlSecurityCheck(this.mediaURL,
                        this.browser.contentPrincipal,
                        Ci.nsIScriptSecurityManager.DISALLOW_SCRIPT);
       openUILink(this.mediaURL, e, { disallowInheritPrincipal: true,
                                      referrerURI: referrerURI });