- #1
my_wan
- 868
- 3
I've created a DLL that contains JavaScript plugins for the IE right click menu like this;
http://img407.imageshack.us/my.php?image=20165640mt5.jpg
I haven't restricted display to the proper context in the registry yet.
In the Alt Text entry I have a small script that looks like;
It simply copies the alt text of an image resource to the clipboard. The problem is that I'm not sure how to retrieve the proper image index of the right clicked image for the script. As you will notice it is simply set to ('img')[0] now which is just the first image on the page.
I would appreciate any suggestions on how to best retrieve the index of the right clicked image.
Any suggestions on more functions to put into the DLL would also be nice.
Functions so far:
arxiv.org
Simply take the selected text of an arxiv.org identify such as 0710.0364 and opens a new page to http://arxiv.org/abs/0710.0364.
Dictionary.com
Simply takes selected text such as Widget and opens a new page on http://dictionary.reference.com/browse/Widget
Google
Searches selected text in a new google window.
Site Search
Takes selected text, or if null the clipboard text, and does a google site search of that site in a new window, i.e., http://www.google.com/search?q=site:www.physicsforums.com+Widget
Wiki
Takes selected text and opens the wiki page for it, i.e., http://en.wikipedia.org/wiki/Widget
I'll be adding clipboard default when selection is null to most functions.
Thanks
http://img407.imageshack.us/my.php?image=20165640mt5.jpg
I haven't restricted display to the proper context in the registry yet.
In the Alt Text entry I have a small script that looks like;
Code:
var altV = external.menuArguments.document.getElementsByTagName('img')[0].attributes('alt').value;
window.clipboardData.setData('Text', altV);
It simply copies the alt text of an image resource to the clipboard. The problem is that I'm not sure how to retrieve the proper image index of the right clicked image for the script. As you will notice it is simply set to ('img')[0] now which is just the first image on the page.
I would appreciate any suggestions on how to best retrieve the index of the right clicked image.
Any suggestions on more functions to put into the DLL would also be nice.
Functions so far:
arxiv.org
Simply take the selected text of an arxiv.org identify such as 0710.0364 and opens a new page to http://arxiv.org/abs/0710.0364.
Dictionary.com
Simply takes selected text such as Widget and opens a new page on http://dictionary.reference.com/browse/Widget
Searches selected text in a new google window.
Site Search
Takes selected text, or if null the clipboard text, and does a google site search of that site in a new window, i.e., http://www.google.com/search?q=site:www.physicsforums.com+Widget
Wiki
Takes selected text and opens the wiki page for it, i.e., http://en.wikipedia.org/wiki/Widget
I'll be adding clipboard default when selection is null to most functions.
Thanks