Saturday, January 22, 2005

Open This URL

I finally sat down to find a solution to a problem that been bothering me for a while now. Sometimes I see a URL in a web site (this mostly happens in forums or blogs), which is not a link, so if you want to see it, you must copy and paste it.

Avant Browser version 10 came with a little toolbar that sometimes show near your selection, but this toolbar is not predictable - I couldn't figure out when exactly Avant decides to show it, and it only has a Search button. Normally, when Google is searched for a URL, this URL is opened, but I don't want to count on this.

So, what I did is creating a file in d:\winnt\web named OpenThisURL.html, with the following content:
<script>
external.menuArguments.open(external.menuArguments.document.selection.createRange().text);
</script>


And I also added a new registry key to HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt named "Open This &URL" with default value set to d:\WINNT\Web\OpenThisURL.html. I also added a binary value named Contexts, with its value set to "10 00 00". Now, after restarting the browser, selecting the URL text, and right-clicking adds an "Open This URL" menu item, which opens it in another window.

This even works well in Avant Browser.

0 Comments:

Post a Comment

<< Home