bug 301119 - Need to allow chrome favicons for XUL error pages, SeaMonkey version, p=hskupin@gmail.com r=Neil
git-svn-id: svn://10.0.0.236/trunk@251894 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -972,10 +972,6 @@
|
||||
const nsIScriptSecurityManager =
|
||||
Components.interfaces.nsIScriptSecurityManager;
|
||||
|
||||
const secMan =
|
||||
Components.classes["@mozilla.org/scriptsecuritymanager;1"]
|
||||
.getService(nsIScriptSecurityManager);
|
||||
|
||||
// Get the IOService so we can make URIs
|
||||
const ioService =
|
||||
Components.classes["@mozilla.org/network/io-service;1"]
|
||||
@@ -985,11 +981,23 @@
|
||||
// Make a URI out of our href.
|
||||
var uri = ioService.newURI(href, targetDoc.characterSet, null);
|
||||
|
||||
try {
|
||||
secMan.checkLoadURIWithPrincipal(event.target.nodePrincipal, uri,
|
||||
nsIScriptSecurityManager.DISALLOW_SCRIPT);
|
||||
} catch (e) {
|
||||
return;
|
||||
// Verify that the load of this icon is legal.
|
||||
// error pages can load their favicon, to be on the safe side,
|
||||
// only allow chrome:// favicons
|
||||
const aboutNeterr = /^about:neterror\?/;
|
||||
if (!(aboutNeterr.test(targetDoc.documentURI) ||
|
||||
!uri.schemeIs("chrome")) {
|
||||
|
||||
const secMan =
|
||||
Components.classes["@mozilla.org/scriptsecuritymanager;1"]
|
||||
.getService(nsIScriptSecurityManager);
|
||||
|
||||
try {
|
||||
secMan.checkLoadURIWithPrincipal(event.target.nodePrincipal,
|
||||
uri, nsIScriptSecurityManager.DISALLOW_SCRIPT);
|
||||
} catch(e) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (isFeed) {
|
||||
|
||||
Reference in New Issue
Block a user