Bug 329521: check image url before viewing image, patch by Martijn Wargers <martijn.martijn@gmail.com>, r=mconnor
git-svn-id: svn://10.0.0.236/trunk@195861 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
a8caf879df
commit
af6e79377e
@ -4599,12 +4599,30 @@ nsContextMenu.prototype = {
|
||||
// Change current window to the URL of the image.
|
||||
viewImage : function (e) {
|
||||
urlSecurityCheck( this.imageURL, this.docURL );
|
||||
openUILink( this.imageURL, e );
|
||||
try {
|
||||
if (this.docURL != gBrowser.currentURI) {
|
||||
const secMan = Components.classes["@mozilla.org/scriptsecuritymanager;1"]
|
||||
.getService(Components.interfaces.nsIScriptSecurityManager);
|
||||
const nsIScriptSecMan = Components.interfaces.nsIScriptSecurityManager;
|
||||
secMan.checkLoadURI(gBrowser.currentURI, makeURI(this.imageURL),
|
||||
nsIScriptSecMan.DISALLOW_SCRIPT);
|
||||
}
|
||||
openUILink( this.imageURL, e );
|
||||
} catch(e) {}
|
||||
},
|
||||
// Change current window to the URL of the background image.
|
||||
viewBGImage : function (e) {
|
||||
urlSecurityCheck( this.bgImageURL, this.docURL );
|
||||
openUILink( this.bgImageURL, e );
|
||||
try {
|
||||
if (this.docURL != gBrowser.currentURI) {
|
||||
const secMan = Components.classes["@mozilla.org/scriptsecuritymanager;1"]
|
||||
.getService(Components.interfaces.nsIScriptSecurityManager);
|
||||
const nsIScriptSecMan = Components.interfaces.nsIScriptSecurityManager;
|
||||
secMan.checkLoadURI(gBrowser.currentURI, makeURI(this.bgImageURL),
|
||||
nsIScriptSecMan.DISALLOW_SCRIPT);
|
||||
}
|
||||
openUILink( this.bgImageURL, e );
|
||||
} catch(e) {}
|
||||
},
|
||||
disableSetDesktopBackground: function() {
|
||||
// Disable the Set as Desktop Background menu item if we're still trying
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user