Bug 386744: "View Image" on <canvas> throws "Error: uncaught exception: Load of denied." r=mano

This commit is contained in:
dolske@mozilla.com 2007-07-03 14:11:15 -07:00
Родитель 74aba047ce
Коммит db93eccb6c
1 изменённых файлов: 12 добавлений и 4 удалений

Просмотреть файл

@ -693,11 +693,19 @@ nsContextMenu.prototype = {
// Change current window to the URL of the image.
viewImage: function(e) {
urlSecurityCheck(this.imageURL,
this.browser.contentPrincipal,
Ci.nsIScriptSecurityManager.DISALLOW_SCRIPT);
var viewURL;
if (this.onCanvas)
viewURL = this.target.toDataURL();
else {
viewURL = this.imageURL;
urlSecurityCheck(viewURL,
this.browser.contentPrincipal,
Ci.nsIScriptSecurityManager.DISALLOW_SCRIPT);
}
var doc = this.target.ownerDocument;
openUILink( this.imageURL, e, null, null, null, null, doc.documentURIObject );
openUILink(viewURL, e, null, null, null, null, doc.documentURIObject );
},
// Change current window to the URL of the background image.