CSS3 in FAR Browser

posted 22 Mar 2013, 08:34 by Robert Chandler   [ updated 13 Feb 2016, 06:58 ]
Translations: Polish

= Quick Fix =

Q. How do I make hh.exe (Microsoft HTML Help viewer for .chm help files) & FAR HTML display CSS3. Like rounded corners?
A. Open Regedit and add the following (affects all users).
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION
DWORD 'hh.exe' = 270f
DWORD 'far.exe' = 270f 
The Microsoft embedded browser runs in IE7 compatibility mode by default so no CSS3 support unless you add your exe file as above.
Alternatively try adding the following to each topic (HTML file) <head> section. Works in a .CHM help file as well.
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE11"/>

= Details =

The Problem

Programmers & users are seeing a common problem. The embedded WebBrowser control used in many Windows applications won't display CSS3 even though IE9 or greater is installed. 
Example: By default this <H1> css won't show the nice rounded corners and background shadow in FAR.exe or hh.exe help viewer, even though IE9 (or greater) browser is installed.

H1  {
         padding: 10px;
         color: White;
         background-color: Blue;
         border: 1px solid black;

         border-radius: 30px;
         box-shadow: 10px 10px 50px red;
}

Hello


Those 2x highlighted CSS3 lines should show round corners and drop shadow, but they won't show in an embedded browser unless you tweak the registry or add a special meta statement. 
This problem also affects Microsoft programs like hh.exe (HTML Help Viewer) for viewing .chm help files. 

Why?

Isn't WebBrowser control suppose to be the same as IE9 browser?
Yes but by default the WebBrowser control is run in the safer "IE7 compatibility mode" which does not support CSS3.

Fix
To enable FAR.exe (or other exes) with embed WebBrowser controls to see CSS3 (all users)...
  1. Open RegEdit 
  2. Go to this reg key (create key if not found)
    HKEY_LOCAL_MACHINE > SOFTWARE > Microsoft > Internet Explorer > Main > FeatureControl > FEATURE_BROWSER_EMULATION
  3. Under the FEATURE_BROWSER_EMULATION key create a 32bit DWORD entry "far.exe" with value 9999 decimal  (this setting enables IE9 features)
  4. Restart FAR.exe and you should now see your CSS3. Notice I've also added hh.exe (Microsoft .CHM HTML Help viewer). 
     

32-bit Applications running under Windows 64-bit OS

If you have a 32 bit application (like far.exe) running under a 64 bit OS then use the Wow6432Node area of the registry.

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION

   

Summing up: 

To enable CSS3 in far.exe (all users)...

HKEY_LOCAL_MACHINE > SOFTWARE > Microsoft > Internet Explorer > Main > FeatureControl > FEATURE_BROWSER_EMULATION > far.exe = (DWORD) 00009999

Alternatively to enable just for the current user

HKEY_CURRENT_USER > SOFTWARE > Microsoft > Internet Explorer > Main > FeatureControl > FEATURE_BROWSER_EMULATION > far.exe = (DWORD) 00009999

And for 32 bit apps running on Windows 64 bit OS use this key

HKEY_LOCAL_MACHINE > SOFTWARE > Wow6432Node > Microsoft... (as above)

Example: MS .chm Help Viewer & FAR

The Windows .chm help file viewer is hh.exe. So this is all you need to do to make HH.exe display CSS3 correctly (and you need a system with IE9 or greater).
Note: The Microsoft documentation also states that you need an appropriate <!DOCTYPE> tag at the top of your HTML file.

HKEY_LOCAL_MACHINE > SOFTWARE > Microsoft > Internet Explorer > Main > FeatureControl > FEATURE_BROWSER_EMULATION
'hh.exe' = 9999 (Dword 32 Decimal)
'far.exe' = 9999 (Dword 32 Decimal)

Here it is as an exported registry file (9999 value is in hex format)

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION]
"far.exe"=dword:0000270f
"hh.exe"=dword:0000270f

Note that hh.exe is a 64 bit executable so on a 64 bit OS so this (above) is the correct key for both 32 bit or 64 bit Windows.
However our far.exe application is 32 bit application only, so on a 64 bit machine we need to use the Wow6432Node key...

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION]
"far.exe"=dword:0000270f

More Info



13-Feb-2016 - Alternative 

Alternatively you can simply add the following statement to the <head> section of all your HTML files.
This works even if the HTML topic files are encapsulated in a .chm help file.


<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE11"/>


More info or search the web.
Comments