From ae5d2db160046e4d4f840791c5f1f723fc8ddf33 Mon Sep 17 00:00:00 2001 From: "mconnor@steelgryphon.com" Date: Mon, 17 Dec 2007 21:31:11 -0800 Subject: [PATCH] bug 251137 - always open javascript and data links in the current tab, r=gavin, a=beltzner --- browser/base/content/browser.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 32c12b4e38f6..6863f424fb50 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -4165,6 +4165,15 @@ function asyncOpenWebPanel(event) var wrapper = null; if (linkNode) { wrapper = linkNode; + + // javascript links should be executed in the current browser + if (wrapper.href.substr(0, 11) === "javascript:") + return true; + + // data links should be executed in the current browser + if (wrapper.href.substr(0, 5) === "data:") + return true; + if (event.button == 0 && !event.ctrlKey && !event.shiftKey && !event.altKey && !event.metaKey) { // A Web panel's links should target the main content area. Do this @@ -4181,12 +4190,6 @@ function asyncOpenWebPanel(event) return true; if (wrapper.getAttribute("onclick")) return true; - // javascript links should be executed in the current browser - if (wrapper.href.substr(0, 11) === "javascript:") - return true; - // data links should be executed in the current browser - if (wrapper.href.substr(0, 5) === "data:") - return true; try { urlSecurityCheck(wrapper.href, wrapper.ownerDocument.nodePrincipal);