Can't get ActiveX WebBrowser to render in anything other than default without using registry key

360 views Asked by At

I have a problem with an ActiveX webbrowser control, ProgID="shell.explorer.2" in a VB.Net addin development to work within SAP Business 1 running 32 bit on a 64 bit server. It's set to display pages from localhost:1234 which is an OWIN SelfHosted WebAPI. The pages in the site use AngularJS.

The problem is well known on SO, and the FEATURE_BROWSER_EMULATION update does work for me, but I need to find another solution. Since I'm writing an Addin, and the hosting EXE is actually "SAP Business One.exe", adding a registry key changes the setup of every Webbrowser control in the application, whether they're mine, part of the application, or even part of someone else's addin.

Since my Angularjs app seems to be happy with IE10, and I want to set the requirement level as low as possible, I want to ask for IE10 rendering.

The doctype has always been <!DOCTYPE html>.

I've tried a <meta http-equiv="x-ua-compatible" content="IE=IE10"> - even right at the top of the <head> and the mode won't switch.

I've added X-UA-Compatible: IE=10 to the response headers at the server-end for .htm files - I can clearly see the header in Fiddler, and the rendering mode won't change.

So my request for help is many fold - can somebody help with the following:

1) Why don't the X-UA-Compatible headers work in either meta form or as a server header which I thought was supposed to override intranet settings? What am I doing wrong?

2) Is there any way to set the rendering mode via a property or method of an activex interface of the webbrowser control, even if I have to resort to C++?

3) Is there any way to wrap the control in such a manner that the advertised owning process is different i.e. matches myaddin.exe name instead of the main application?

I really would like to get this mode switch working, otherwise I may have to rewrite using IE7 compatible code, which I really don't want to have to do!

Thanks in advance for any help,

Mark

0

There are 0 answers