From 0872a4b19643a3e02d74d3b01b50ded693a860f7 Mon Sep 17 00:00:00 2001 From: "neil%parkwaycc.co.uk" Date: Sun, 30 Jan 2005 21:57:18 +0000 Subject: [PATCH] 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 --- mozilla/browser/base/content/metaData.js | 30 ------------------- .../browser/resources/content/metadata.js | 24 --------------- 2 files changed, 54 deletions(-) diff --git a/mozilla/browser/base/content/metaData.js b/mozilla/browser/base/content/metaData.js index 9468756cf6d..6fb65f6e50e 100644 --- a/mozilla/browser/base/content/metaData.js +++ b/mozilla/browser/base/content/metaData.js @@ -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 or which uses an imagemap. * If more then one object is found we can't determine which one diff --git a/mozilla/xpfe/browser/resources/content/metadata.js b/mozilla/xpfe/browser/resources/content/metadata.js index a7bfce84436..35ffe1a8adb 100644 --- a/mozilla/xpfe/browser/resources/content/metadata.js +++ b/mozilla/xpfe/browser/resources/content/metadata.js @@ -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 or which uses an imagemap. * If more then one object is found we can't determine which one