Lost Microsoft Edge (Chromium) IE Mode showModalDialog zoom level

400 Views Asked by At

Legacy Web application support. This is a use case when End-users access the Site from the 'Remote Desktop Connection'.

On Microsoft Windows (Server 2016/ 2019) versions the Microsoft's legacy feature showModalDialog zoom-level screen.deviceXDPI appears to be lost, meaning zoom is reset to default ctrl+0 zoom-level.

According to Microsoft the expected behavior would be that zoom-level is preserved [ Reference: https://learn.microsoft.com/en-us/troubleshoot/developer/browsers/core-features/new-window-not-respect-zoom-level, Date 20.10.2022]

In Internet Explorer 9 and later versions, windows created using the window.open API (as well as showMod[al:eless]Dialog and createPopup) have been designed to not honor the Reset zoom level for new windows and tabs setting and always inherit the zoom factor from their parent page.

I have not been able to trace this behavior to specific Microsoft Edge, Internet Options setting. No error message found. The issue is not present in IE11.

Setup

  • Verified on Microsoft Edge Version 106.0.1370.47 (Official build) (64-bit) - Issue is present already for several versions, since discovered earlier this year when migrating away from IE11
  • Microsoft Edge with IE mode. IE mode enables backward compatibility to Enterprise support
    <site url="localhost/SiteName">
        <compat-mode>IE8Enterprise</compat-mode>
        <open-in>IE11</open-in>
    </site>
  • Opener and modal window has the same host, port and http scheme.
  • Both http or https are verified, both localhost or domain verified
  • Site is added to Trusted Sites
  • Site is not in Compatibility view Settings Websites list
  • Protected mode not enabled for Trusted sites (not ticked)
  • The Server's Browser is accessed from 'Remote Desktop Connection'
  • Works with versions tested: Windows 10 (1909) - two instances verified, Windows Server 2012 R2 (9600)
  • Not Working Windows Server 2019 (1809) - two instances verified, Windows Server 2016 (1607)

What has been tried

  • Internet Options, Advanced - Restore and Advanced - Restore Advanced Settings
  • Microsoft Edge Reset Settings - Restore settings to their default values
  • Internet Options, Advanced 'Reset zoom level for new windows and tabs' (not ticked). Seems to have no effect if ticked
  • Reinstall Edge
  • Changing Zoom related Registries seems to have no effect on Edge IE Mode, Registries under HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Zoom or Computer\HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\microsoft.microsoftedge_8wekyb3d8bbwe\MicrosoftEdge\Zoom
  • Verified issue with different resolution monitors that, the same if zoom ctrl+0 is 100% or 200%

Reproduction html Opener html (Note: ZoomLevel scale not converted to percentage here)

    <!doctype html>
    <html>
    <head>
        <title>Open Modal Dialog Test</title>
        <script type="text/javascript">
            function ready(callback) {
                document.attachEvent('onreadystatechange', function () {
                    if (document.readyState == 'complete') callback();
                });
            }
    
            ready(function () {
                var zoomLevel = screen.deviceXDPI / screen.logicalXDPI;
                document.getElementById("zoomLevel").innerHTML = zoomLevel;
        
                document.getElementById("deviceXDPI").innerHTML = screen.deviceXDPI;
                document.getElementById("logicalXDPI").innerHTML = screen.logicalXDPI;
                document.getElementById("systemXDPI").innerHTML = screen.systemXDPI;
    
                var ls_arguments = { zoomLevel: zoomLevel };
    
                var url = "modalDialog2.htm?v=" + new Date();
                window.showModalDialog(url, ls_arguments, "center:yes;dialogWidth:600px;dialogHeight:300px;status:yes;resizable=yes");
            });
        </script>
    </head>
    <body>
        Sample text
        Opener zoom: <div id="zoomLevel"></div>
        <p>deviceXDPI: <span id="deviceXDPI"></span></p>
        <p>logicalXDPI: <span id="logicalXDPI"></span></p>
        <p>systemXDPI: <span id="systemXDPI"></span></p>
    </body>
    </html>

Modal html

    <!doctype html>
    <html>
    <head>
        <title>Modal Dialog</title>
        <script type="text/javascript">
            function ready(callback) {
                document.attachEvent('onreadystatechange', function () {
                    if (document.readyState == 'complete') callback();
                });
            }
    
            ready(function () {
                document.getElementById("zoomLevel").innerHTML = screen.deviceXDPI / screen.logicalXDPI;
                document.getElementById("zoomLevelParent").innerHTML = window.dialogArguments.zoomLevel;
                
                document.getElementById("deviceXDPI").innerHTML = screen.deviceXDPI;
                document.getElementById("logicalXDPI").innerHTML = screen.logicalXDPI;
                document.getElementById("systemXDPI").innerHTML = screen.systemXDPI;
            });
        </script>
    </head>
    <body>
        Sample text
        <p>Modal zoom: <span id="zoomLevel"></span></p>
        <p>Opener zoom: <span id="zoomLevelParent"></span></p>
        <p>deviceXDPI: <span id="deviceXDPI"></span></p>
        <p>logicalXDPI: <span id="logicalXDPI"></span></p>
        <p>systemXDPI: <span id="systemXDPI"></span></p>
    </body>
    </html>

Example #1 Server 2019 Opener Zoom 250% (status bar) (Edge shows zoom 150%)

  • deviceXDPI: 240
  • logicalXDPI: 96
  • systemXDPI: 192

Modal Dialog zoom

  • deviceXDPI: 192
  • logicalXDPI: 96
  • systemXDPI: 192

Expected would be that deviceXDPI for Modal zoom window would be 240

Example #2 Server 2016 Screenshot from example code

Edge IE Mode zoom reset on showModalDialog

Expected that deviceXDPI for Modal window would be 77 same as for opener.

Expected the same behavior if tested on IE11 Enterprise mode on the same machine IE11 Zoom preserved on showModalDialog

0

There are 0 best solutions below