View Source improvements in IE8

March 27, 2009 at 10:38 PMBen

Compared to Firefox and Chrome, IE has always had a very plain rendering when viewing the source of an HTML page.  The source just shows up as plain text in Notepad.  HTML is of course just plain text, but Firefox and Chrome add coloring for matching HTML tags which makes looking at the source a little more pleasant.

IE8 now does what these others browsers have been doing.  The HTML source no longer is displayed in Notepad, but in an IE source viewing pop-up window.  This IE source viewer now does tag coloring and even includes line numbers.  This is a nice little improvement.

IE8 Source Viewer

I did notice one other interesting feature when doing a View Source in IE8.  On the File menu of the source viewer, if you select 'Save', you have a choice to save the HTML Source (nothing special here) or save the 'Formatted HTML View' (screenshot below).  This "save formatted HTML view" will create an HTML file of how IE8's source viewer is displaying the source -- including the tag coloring.  You can then open up that saved HTML file in any browser to have the source display exactly as it does in IE8's source viewer.

IE8 Source Viewer - Save as Formatted HTML View

The file size of the "formatted html view" is considerably larger than the size of the plain HTML source without the formatting.  For instance, for a particular 45 KB HTML page I tried this in, the formatted html view file is 452 KB.

I'm guessing the new color tags and syntax highlighting in the new source viewer was done via HTML markup.  So it probably wasn't a big deal for the IE team to just include this new save as 'Formatted HTML View' option -- since the formatted HTML source was already there.  In any event, it's nice it's there for whenever the need of the formatted html source could be used.

Posted in: General

Tags: , ,

Comments (1) -

Rajeev Datta
Rajeev Datta says:

This view source display is from long time part of IE Deveploment Toolbar.

Comments are closed