4

Im developing a custom browser solution with .net's Webbrowser control. To disable the IE-Compatibilty View, I set the registry entry Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION:

[Sreenshot regedit] http://zbirk.mirk.at/browserreg.png "Screenshot"

i tried to use the values: dword=8000,dword=8888,dword=9000, but the webbrowser control seems to ignore these reg entries.

Maybe someone had this problems too and may help me.

dgw
  • 13,418
  • 11
  • 56
  • 54
David
  • 51
  • 1
  • 3
  • 1
    This issue occurs consistently when running VS2010 x64 in the debugger. However, after publishing the app and running the .exe the registry setting that you describe takes effect properly. – pgfearo Jun 06 '12 at 19:11
  • 8001, 9001 will work as it does not depend on DocTypes – Sivaraman May 29 '18 at 08:30

5 Answers5

3

The WebBrowser control definately DOES respect these keys.

Remember that while taskman may show application.exe in the name column, if you are debugging the exe name is application.vshost.exe

So in my application sI just attempt to create the key every time the app runs. If it fails to create it (because it already exists) then I continue running, if it creates the key then I inform the user that they need to restart the application.

Sam Axe
  • 33,313
  • 9
  • 55
  • 89
2

ensure that you are not running within vshost

the app name would be different ie appname.vshost.exe

Ian---
  • 63
  • 5
1

I too could not see that FEATURE_BROWSER_EMULATION made any difference in my application.

I was testing the FEATURE_BROWSER_EMULATION functionality by manually editing the registry with regedit. Nothing I did made any difference. My hosted page was still failing on any new-ish JavaScript and could not load external libraries.

I found my mistake:

I was editing the 64-bit view of the registry with regedit. My app was running as a 32-bit app and looking at the 32-bit view of the registry. That's why my changes to the registry seemed to have no impact on my application. By the way, the WPF project template defaults to "Prefer 32-bit."

Manually editing with regedit within the Wow6432Node key worked:

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

Of course, setting the DWORD value programmatically within your application will also work, since your 32-bit application will edit within the Wow6432Node.

Wallace Kelly
  • 15,565
  • 8
  • 50
  • 71
1

Thx for your reply, now its working.

Her is my working peace of code:

public void setIEcomp()
    {
        String appname = Process.GetCurrentProcess().ProcessName+".exe";
        RegistryKey RK8 = Registry.LocalMachine.OpenSubKey("Software\\Microsoft\\Internet Explorer\\Main\\FeatureControl\\FEATURE_BROWSER_EMULATION",RegistryKeyPermissionCheck.ReadWriteSubTree);            
        int value9 = 9999;
        int value8 = 8888;
        Version ver = webBrowser1.Version;
        int value = value9;
        try
        {
            string[] parts = ver.ToString().Split('.');
            int vn = 0;
            int.TryParse(parts[0], out vn);
            if (vn != 0)
            {
                if (vn == 9)
                    value = value9;
                else
                    value = value8;
            }
        }
        catch
        {
            value = value9;
        }
        //Setting the key in LocalMachine
        if (RK8 != null)
        {
            try
            {
                RK8.SetValue(appname, value, RegistryValueKind.DWord);
                RK8.Close();
            }
            catch(Exception ex)
            {
                //MessageBox.Show(ex.Message);
            }
        }
    }
David
  • 51
  • 1
  • 3
  • 1
    If you solved it you should accept some answer. Have you solved it? – Coder12345 Oct 10 '13 at 19:39
  • I wonder if you were initially editing the 64-bit view of the registry with regedit. When you switched to setting the key programmatically, it worked because your program was editing the 32-bit view of the registry. – Wallace Kelly Mar 17 '17 at 18:38
0

An older post and solution is no longer accurate.

Running procmon and watching for FEATURE_BROWSER_EMULATION shows the following registry variables actually checked. This was for WINWORD.exe but other than that - take your pick...

HKU\S-1-5-21-[my-sid-paws-off]\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION\WINWORD.EXE

HKU\S-1-5-21-[my-sid-paws-off]\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION*

HKLM\SOFTWARE\Microsoft\Office\ClickToRun\REGISTRY\MACHINE\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION(Default)

HKLM\SOFTWARE\Microsoft\Office\ClickToRun\REGISTRY\MACHINE\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION\WINWORD.EXE

HKLM\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION\WINWORD.EXE

HKLM\SOFTWARE\Microsoft\Office\ClickToRun\REGISTRY\MACHINE\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION*

HKLM\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION*

user1318024
  • 342
  • 2
  • 6