Hi, I want to write simple IE addon in form of adding context button to the IE. That is simple, you just create new registry entry. Acter clicking that button, you script is executed and can access parent window objects. My problem is, is there a wa yin javascript how to get URL of the hyperlink which is currently active? I mean, mouse is on it? Thanks.
Get active hyperlink ?
Started by pokevitek, Sep 17 2010 10:26 PM
2 replies to this topic
#1
Posted 17 September 2010 - 10:26 PM
|
|
|
#2
Posted 17 September 2010 - 11:04 PM
Here you can find some examples for various types of actions.
Basically you should specify that your new context-menu option is for anchors (setting 0x20 in Contexts value of the registry). And then you can access the selected link as shown (example taken from the previous web page):
Basically you should specify that your new context-menu option is for anchors (setting 0x20 in Contexts value of the registry). And then you can access the selected link as shown (example taken from the previous web page):
var aDestination = "http://www.google.com/search?q=cache:" var aWindow = window.external.menuArguments; var aDocument = aWindow.document; var anEvent = aDocument.parentWindow.event; var aLink = anEvent.srcElement; aWindow.open(aDestination + aLink);aLink contains the url you want.
#3
Posted 17 September 2010 - 11:39 PM
You just help me A LOT. Thank you.


Sign In
Create Account


Back to top









