I want to create an extension in Firefox that extracts links embedded on a web page from users moving the mouse on the link. This would be very similar to link target display on the status bar at the bottom of the browser.
The problem I am having is getting access to document object of the loaded webpage. I tried document.getElementsByTag("a")
it didn't work. I tried content.document.getElementByTag("a")
it didn't work.
Ideally I want it to behave like this:
A few things:
document
is the document of the browser, not of a webpage, so you do want content.document
. getElementsByTagName
. Use the error console -- it should tell you that getElementsByTag
is not a function.content.document.links
if (event.target instanceof HTMLAnchorElement)
or something to see if it's a link.unload
event).