When I was writing a small HTA application that was using Internet Explorer, I noticed that it was not running in IE8 mode it was running IE7 mode.

To verify you can try this in IE8: javascript:alert(navigator.userAgent)

image

Here you see that IE8 is running in IE8 mode

While in my HTA application

image

And as you can see the application is running in IE7 mode.

Get the source code for my Small Internet Explorer here: Small Internet Explorer

 

To solve this, fire up the regedit and browse to the key:

[HKLM|HKCU]\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION

If you have a 64-bit Windows and want to control the 32-bit Internet Explorer this it the key:

[HKLM|HKCU]\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION

Now create a DWORD Value where the name is your application, in this case mshta.exe and decimal value 8.

image

 

For more information about these settings and possible values check out MSDN:

http://msdn.microsoft.com/en-us/library/ee330730(VS.85).aspx

One response to “Force IE8 mode in HTA”

  1. Hey, i know that IE and HTAs are seen as dinosaurs these days, but I still want to look at your Small IE HTA.

    Unfortunately the link seems to be broken, taking me to my office 365 front page?

    Can you make the code available again? (Maybe on Github?)

    Like

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Quote of the week

"People ask me what I do in the winter when there's no baseball. I'll tell you what I do. I stare out the window and wait for spring."

~ Rogers Hornsby