I know similar problems have been posted here before. I know this because I've searched this site for solutions, but the ones I've found haven't worked out for me.
I have a problem with the web browser control. Right now, it renders pages like an old version of Internet Explorer. I need it to render them as Microsoft Edge or Chrome would have. Some of the solutions I found to other people's versions of the same problem include inserting the HTML tag. That did not work for me.
The other solution, which seems to do the trick for a lot of people, is to create a value in the registry database with the name of your application (e.g. myApp.exe) and a integer value representing what Internet Explorer-version you want the web browser control to behave as - the decimal value 10001, apparently, being Edge and 8888 and 9999 being the most recent versions of Internet Explorer.
should equal 11 for Edge when it works (that is, when the web browser control behaves as Edge due to the 10001 value in the registry database). Needless to say, here documentMode is set to 5, like it completely ignores the registry values I've set. I've created both relative and absolute paths to my EXE (a Visual Studio debug build) in both the 32-bit and 64-bit parts of regedit, and in both HKEY_CURRENT_USER and HKEY_LOCAL_MACHINE. I wasn't allowed to touch the latter with C#. Running my app without administrator privileges threw an exception; with admin privileges it just ignored my attempt to create a value in HKEY_LOCAL_MACHINE.
This is the code I wrote:
public partial class MainForm : Form
const string regValue32cu = @"HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION";
const string regValue64cu = @"HKEY_CURRENT_USER\Software\wow6432node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION";
const string regValue32lm = @"HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION";
const string regValue64lm = @"HKEY_LOCAL_MACHINE\Software\wow6432node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION";
const uint value = 10001U;
private void MainForm_Load(object sender, EventArgs e)
browser.DocumentText = "<script>document.write('Document Mode: ' + document.documentMode);</script>";
What am I doing wrong? My exe is called YouseeLoader.exe. It is not a part of the PATH environment variable. The goal of my app is to be able to extract the part of https://tv.yousee.dk/tv-guide
] that is being inserted in the
element in Edge and Chrome, but not in older versions of Internet Explorer, but for now, I just want the web browser control to render properly like Edge and Chrome.
Thank you in advance,
What I have tried:
Controlling WebBrowser Control Compatibility | Microsoft Docs
] (article using document.documentMode with pictures)
internet explorer 8 - How to set FEATURE_BROWSER_EMULATION to IE8 mode? - Stack Overflow
] (32- and 64-bit registry keys)
Internet Feature Controls (B..C) (Internet Explorer) | Microsoft Docs
] (MSDN article on browser emulation and value description)