bug 251137 - always open javascript and data links in the current tab, r=gavin, a=beltzner

This commit is contained in:
mconnor@steelgryphon.com 2007-12-17 21:31:11 -08:00
parent 54cc92b2f5
commit fe0c3ee2e7

View File

@ -4165,6 +4165,15 @@ function asyncOpenWebPanel(event)
var wrapper = null; var wrapper = null;
if (linkNode) { if (linkNode) {
wrapper = 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 && if (event.button == 0 && !event.ctrlKey && !event.shiftKey &&
!event.altKey && !event.metaKey) { !event.altKey && !event.metaKey) {
// A Web panel's links should target the main content area. Do this // A Web panel's links should target the main content area. Do this
@ -4181,12 +4190,6 @@ function asyncOpenWebPanel(event)
return true; return true;
if (wrapper.getAttribute("onclick")) if (wrapper.getAttribute("onclick"))
return true; 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 { try {
urlSecurityCheck(wrapper.href, wrapper.ownerDocument.nodePrincipal); urlSecurityCheck(wrapper.href, wrapper.ownerDocument.nodePrincipal);