1

I need to change IE version, they told me I have to do it in the registry during install, I have no idea how to modify the install.

I put a web browser control on a win form and navigate it to translate.google.com, it used to work but stopped working on the new design of their website!

The code is in my site under "TranslateProgram": https://sites.google.com/site/workofmylife1234/

If I add these simple lines to my code will translate.google.com work?

var appName = System.Diagnostics.Process.GetCurrentProcess().ProcessName + ".exe";

using (var Key = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION", true))
    Key.SetValue(appName, 99999, RegistryValueKind.DWord);
Wai Ha Lee
  • 8,598
  • 83
  • 57
  • 92
  • 1
    `IE` is deprecated, if you want to use google translate consider using their `API`. if you can't consider another web engine like `CefSharp` for ex – Abdo Dec 29 '18 at 12:18
  • Thx, I want a full Google Translate website with the language detection suggestion and easily change languages and save history of terms and a nice comfy view and user friendly... can API know the detected input language? anyway I'm still convinced a full website is the best... someone told me I can change IE version in program's install and translate.google.com would work... – Joe Carpenter Dec 29 '18 at 12:25
  • `Api`s are just an interface to the same engine so you can build your own version that fits your app in top of it, that said i think google translation api costs money per usage so there is that. if you need to change ie version for your app you can try [This answer](https://stackoverflow.com/questions/17922308/use-latest-version-of-internet-explorer-in-the-webbrowser-control) keep in mind i am not sure if this will solve google translation issue with `ie` from what i know `microsoft` and possibly `google translate team` deprecated `ie` – Abdo Dec 29 '18 at 12:42
  • to get started with the api take a look at their quick start guide[https://cloud.google.com/translate/docs/quickstart-client-libraries](https://cloud.google.com/translate/docs/quickstart-client-libraries) – Abdo Dec 29 '18 at 12:42
  • Thx, plz see edited question. – Joe Carpenter Dec 29 '18 at 13:06
  • [How can I get the WebBrowser control to show modern contents?](https://stackoverflow.com/q/38514184/3110834) – Reza Aghaei Dec 29 '18 at 15:22
  • I want it done automatically to everyone who downloads and installs my program from my site, does the code I edited into my question work?, the page you linked to shows manual registry work. https://sites.google.com/site/workofmylife1234/ – Joe Carpenter Dec 29 '18 at 16:08
  • Thx, the code in the link you provided and I added to my question as an edit worked, you can add it as an answer and I would accept it. – Joe Carpenter Dec 29 '18 at 17:25
  • var appName = System.Diagnostics.Process.GetCurrentProcess().ProcessName + ".exe"; using (var Key = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION", true)) Key.SetValue(appName, 99999, RegistryValueKind.DWord); – Joe Carpenter Dec 29 '18 at 17:31

1 Answers1

0

This works like magic, I've had a sad time when Google stopped working and this could have fixed it, I didn't have my program for a long time for a stupid reason.

Get the WebBrowser control to show modern contents:

The WebBrowser control uses the same Internet Explorer version which is installed on your OS but it doesn't use the latest document mode by default and shows content in compatibility mode.

As a symptom, you can see the site in Internet Explorer, but WebBrowser control doesn't show the site correctly and for some sites it shows script error too.

Solution:

You can tell the WebBrowser control to use the latest document mode without compatibility mode in WebBrowser control. You can follow instructions here to disable the setting using registry.

This sets IE version in the current process to 99999 which means the maximum version.

var appName = System.Diagnostics.Process.GetCurrentProcess().ProcessName + ".exe";

using (var Key = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION", true))
{
   Key.SetValue(appName, 99999, RegistryValueKind.DWord);
}

What Happens if I Set the FEATURE_BROWSER_EMULATION Document Mode Value Higher than the IE Version on the Client?

Obviously, the browser control can only support a document mode that is less than or equal to the IE version installed on the client. Using the FEATURE_BROWSER_EMULATION key works best for enterprise line of business apps where there is a deployed and support version of the browser. In the case you set the value to a browser mode that is a higher version than the browser version installed on the client, the browser control will choose the highest document mode available.

My program and source code are here: https://sites.google.com/site/workofmylife1234/