Friday, December 14, 2007

View Source with something else than Notepad in Internet Explorer

I'm doing some web development at the time, and since Internet Explorer is the customer's and their customers' preferred web browser, it is a good idea to check how the pages look even in IE (of course, Mozilla Firefox is my own open source preference).

If you want to check the source the browser is actually reading, the IE7's Page-View Source menu item will take you to a Notepad window with the source. I want to look at it in my favorite plain text editor, Notepad++ though, where I can view the code color highlighted. I might even want to clean up what I see so that the source is indented in a readable format, using the TextFX with HTML Tidy option.

So - to my business: How do I change the View Source option to run the text editor I want? Simply by a small registry hack:

------------8<----------------8<------------------
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\View Source Editor\Editor Name]
@="\"C:\\Program Files\\Notepad++\\notepad++.exe\""

------------8<----------------8<------------------

Cut and paste this into a .reg file and import to registry (if you are uncertain of how to do that, don't even try - messing with the registry is not for you). Of course, if you want to use another text editor, just change the file path accordingly. If you need to undo this hack, just delete the "View Source Editor" registry key with its full contents.

This is actually just a copy of another blog I found googling for a solution: The Thea Burger's Blog and Will's blog - Thanks for helping me out!

No comments: