Shantanu Garg wrote:
Hi ,
    I am writing an application which embeds mozilla. There are some links
in my custom html page which doesn't point to any content, but it has some
significance for me. Due to backward compatibility I cannot change the html
pages. Is there anyway i can get OnLinkClick() kind of event in my
application, so that I can perform my custom actions on them and tell
mozilla to stop. I tried nsIWebProgressListener::OnStateChange(), but
mozilla displays "content not found" and then never calls the OnStateChange
method.

There's no onLinkClick event. All you can handle is onClick. I suggest stepping through each link and add some event listeners:

//quickhack (untested)
onload = function() {
  var myLinks = document.links;
  for (i=0; i<myLinks.length; i++) {
    myLinks[i].onclick = onLinkClick;
  }
};

function onLinkClick(e) {
  //do something;
  // return false to not following the link href
  return false;
}

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

Reply via email to