0

This may be a somewhat silly question, but have you ever wanted to write a text file whose only contents were a hyperlink, such that when the user clicks on this file, the web browser of choice launches and loads up the webpage corresponding to such hyperlink. The file extension of such a file could be, say, .hln, and by right clicking on any one of these files in Windows you could associate the browser of choice with such an extension as the default application to be launched. The only problem is, the browser must recognize the extension. I wonder whether anyone else thinks the behavior I describe here could be useful and whether such functionality could be achieved, say, by writing a web browser plugin for one of the most common web browsers such as chrome or mozilla.

Thanks.

1 Answer 1

1

You can archieve this using a simple shortcut.

The easiest way to create one is to open your favorite webbrowser (I know Opera and Internet Explorer both support this, but Firefox and Chrome should too) and drag and drop the url to your desktop or other place on your harddrive.

This file can then be copied to other locations, and if you doubleclick it, the browser that is set as default will be used to navigate there.

All webbrowsers will be able to open this file.

4
  • Thank you @LPChip for your answer. I tried this in both FireFox and Chrome and your solution works. The only disappointing thing is that when I do this in FireFox the icon looks like a blank white paper page and has no FireFox icon on it; it could have looked a little bit nicer. With Chrome, on the other hand, when I do this I get a white paper page with a nice 'g' on a blue background. Files dragged from the FireFox URL open with FireFox and files dragged from the Chrome URL open with Chrome, as expected. I am running Windows 7. Thanks again! Dec 2, 2014 at 19:01
  • I have another question for you related to this post. I have inspected the properties of the files created as above. Each one of these files has an extension of .URL and when I right-click on each of these Windows 7 doesn't give me the option to open them with a text editor so I can't see the format of their contents in plain ASCII, but I suspect that somehow the name of the executable browser file used to open these .URL files is also stored within such .URL files. I've mounted my windows partition on a Linux partitions and in this manner was able to open the files. Dec 2, 2014 at 19:11
  • Their contents are human-readable and consist of [InternetShortcut]\nURL=theURLhere\nIDList=\nHotKey=\nIconFile=pathToIconFileHere\nIconIndex=0 in the case of .URL files created by FireFox and just [InternetShortcut]\nURL=theURLhere in the case of .URL files create by Chrome. Dec 2, 2014 at 19:16
  • What preplexes me is, if the file extensions for these files is the same, how does Windows know how to open them with DIFFERENT web browser applications? Thanks. Dec 2, 2014 at 19:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .