Bug 224141 Remove unused function openLink p=gautheri@noos.fr r=mconnor sr=jag

git-svn-id: svn://10.0.0.236/trunk@168535 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
neil%parkwaycc.co.uk
2005-01-30 21:57:18 +00:00
parent e01d005842
commit 0872a4b196
2 changed files with 0 additions and 54 deletions

View File

@@ -374,36 +374,6 @@ function hideNode(id)
document.getElementById(id).setAttribute("style", "display:none;" + style);
}
const nsIScriptSecurityManager = Components.interfaces.nsIScriptSecurityManager;
// opens the link contained in the node's "value" attribute.
function openLink(node)
{
var url = node.getAttribute("value");
// Security-Critical: Only links to 'safe' protocols should be functional.
// Specifically, javascript: and data: URLs must be made non-functional
// here, because they will run with full privilege.
var safeurls = /^https?:|^file:|^chrome:|^resource:|^mailbox:|^imap:|^s?news:|^nntp:|^about:|^mailto:|^ftp:|^gopher:/i;
if (safeurls.test(url)) {
var sourceURI = Components.classes["@mozilla.org/network/standard-url;1"]
.createInstance(Components.interfaces.nsIURI);
sourceURI.spec = nodeView.content.document.location;
var destURI = Components.classes["@mozilla.org/network/standard-url;1"]
.createInstance(Components.interfaces.nsIURI);
destURI.spec = url;
var secMan = Components.classes["@mozilla.org/scriptsecuritymanager;1"].getService()
.QueryInterface(nsIScriptSecurityManager);
try {
secMan.checkLoadURI(sourceURI, destURI, nsIScriptSecurityManager.STANDARD);
} catch (e) {
return;
}
nodeView.content.document.location = url;
window.close();
}
}
/*
* Find <img> or <object> which uses an imagemap.
* If more then one object is found we can't determine which one

View File

@@ -381,30 +381,6 @@ function hideNode(id)
document.getElementById(id).setAttribute("style", "display:none;" + style);
}
const nsIScriptSecurityManager = Components.interfaces.nsIScriptSecurityManager;
// opens the link contained in the node's "value" attribute.
function openLink(node)
{
var url = node.getAttribute("value");
// Security-Critical: Only links to 'safe' protocols should be functional.
// Specifically, javascript: and data: URLs must be made non-functional
// here, because they will run with full privilege.
var safeurls = /^https?:|^file:|^chrome:|^resource:|^mailbox:|^imap:|^s?news:|^nntp:|^about:|^mailto:|^ftp:|^gopher:/i;
if (safeurls.test(url)) {
var secMan = Components.classes["@mozilla.org/scriptsecuritymanager;1"].getService().
QueryInterface(nsIScriptSecurityManager);
try {
secMan.checkLoadURIStr(nodeView.content.document.location,
url, nsIScriptSecurityManager.STANDARD);
} catch (e) {
return;
}
nodeView.content.document.location = url;
window.close();
}
}
/*
* Find <img> or <object> which uses an imagemap.
* If more then one object is found we can't determine which one