HTMLViewer under Win10 - perhaps not a subclassing issue after all

  1. 8 months ago

    Tim S

    10 Feb 2019 Canterbury, UK
    Edited 8 months ago

    I've been doing some testing in both Win7 and Win10 VMs, trying to run a big chunk of obscurely written javascript in a an HTMLViewer. When I first tried this in Win7, there were a couple of javascript errors; then I can across the doc on the HTMLviewer page that suggested updating to IE11 and more particularly asking (by making some registry entries) that one's app be given the IE11 renderer instead of the default. No more JS errors after that.

    I repeated the exercise under Win10, and to my chagrin the same errors were back again. After some amount of fiddling around in the IE11 debugger, I noticed that it seemed to default to rendering as IE7, and the debugger even gave a message saying that this was because the Compatibility Setting "Display intranet sites in Compatibility View" was set. After I turned this off, all was well - again, no more JS errors. So IE configuration settings affect how the renderer works, and a local file loaded with LoadPage is counted as such a "site".

    This setting appears to exist because larger MS customers with intranets where they run old unmaintained websites need to have IE11 run in quirks mode.

    Is there any way to affect IE11 settings from within a Xojo app?

  2. Julian S

    10 Feb 2019 Pre-Release Testers, Xojo Pro UK
    Edited 8 months ago

    Oh you're pulling the content from a local folder? That changes a lot re: our last conversation as the browser will be under a totally different security model :(

    Try putting this right at the top of <head>, it will attempt to force the browser into the version 11 which should bypass the Compatibility View setting.

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

    If that doesn't work, you can try and set this via headers:

    "X-UA-Compatible: IE=11"

    using something like a locally hosted aloe server which will be a lot more lenient in terms of the security model, you might not even need to do this then, only testing will confirm that.

    See this post for a list of other setting and explanations:

    https://stackoverflow.com/questions/6771258/what-does-meta-http-equiv-x-ua-compatible-content-ie-edge-do

    EDIT

    As for physically altering the "Display intranet sites in Compatibility View" setting, that's a bit of a no go as its a policy setting which could be centrally controlled by an admin so wouldn't be guaranteed to work and could expose the browser to all sorts of problems if you start reducing the security model of a persons computer.

  3. Tim S

    10 Feb 2019 Canterbury, UK

    @Julian S Oh you're pulling the content from a local folder? That changes a lot re: our last conversation as the browser will be under a totally different security model :(

    The file I load comes from the Resources folder (this is a desktop app).

    Try putting this right at the top of <head>, it will attempt to force the browser into the version 11 which should bypass the Compatibility View setting.

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

    That looks like just what I need.

    See this post for a list of other setting and explanations:

    https://stackoverflow.com/questions/6771258/what-does-meta-http-equiv-x-ua-compatible-content-ie-edge-do

    That is very detailed and helpful, thanks.

    EDIT

    As for physically altering the "Display intranet sites in Compatibility View" setting, that's a bit of a no go as its a policy setting which could be centrally controlled by an admin so wouldn't be guaranteed to work and could expose the browser to all sorts of problems if you start reducing the security model of a persons computer.

    Yes, it would have been somewhat an act of desperation. Overriding it as described above is obviously much better, and avoids the user having to alter their IE setting to make my app work. Anyway - testing soon. I may well submit a documentation update on this, too.

    Thanks again.

  4. Greg O

    10 Feb 2019 Xojo Inc

    You might also want to try IE=Edge. While it does not get you the Edge engine, it will get you the latest available version on the computer, even if that happens to be IE10.

or Sign Up to reply!