Raymond wrote:
However, some websites contain links (e.g. <a target=_blank
href="http://www.abc.com";>ABC</a>) which I do not have any control of the
newly opened windows.  Do I need to do something in the mozilla source code
in order to get around this problem?

You need to change those links dynamically. Remove the target attribute and set an onclick handler.


// (untested)

function openNewWin() {
  var win = window.open(this.href,this.href.replace(/[^a-zA-Z]/g,""));
  // you may add properties and functions to the new window
  // or do anything else here
}

var allLink = document.getElementsByTagName("a");
for (var i=0; i<allLink.length; i++) {
  if (allLink[i].getAttribute("target") == "_blank") {�
    allLink.removeAttribute("target");
    allLink.onclick=openNewWin;
  }
}

HTH
Daniel
_______________________________________________
Mozilla-xpcom mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-xpcom

Reply via email to