Lost Microsoft Edge (Chromium) IE Mode showModalDialog zoom level - microsoft-edge

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
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

Related

our angular application isn't working from IOS 15 (Safari) , it works for older versions of safari and other browsers

Application is not loading in safari 15 and higher versions, there are no console errors.
In chrome our application is being detected as angular application and the component is loaded as Angular widget component here
Where as in safari it is loaded as
Screenshots attached.
Source code:
<script>
var angWidgets = 'unauthenticated';
var cId = '#ViewBag.ClientId';
</script>
#{string angWidgetsHtml = "<unauthenticated></unauthenticated>";}
<app></app>
<script>
var angWidgetsHtml = "#Html.Raw(angWidgetsHtml)";
</script>
Inspect source code image in Safari
Inspect source code image in chrome

In google sheets add some kind of dialog box that will display on an ipad

I am trying to add a yes/no message box to a google sheet that will display on an iPad. I have tried all the things below but none of them display the message. My goal is if the user changes a field the macro will change other fields if the user says it is ok. I can get this to work on a windows machine with no issues but when I try it on an ipad the message never appears. At this point I am just trying to get a message box to appear. This is what I have tried
1.
function onEdit(e) {
Browser.msgBox("test");
}
Result: The macros times out
2.
function onEdit(e) {
var html = HtmlService.createHtmlOutputFromFile('Page')
.setWidth(400)
.setHeight(300);
SpreadsheetApp.getUi() // Or DocumentApp or SlidesApp or FormApp.
.showModalDialog(html, 'My custom dialog');
}
Page.html:
<!DOCTYPE html>
<html>
<head>
<base target="_top">
</head>
<body>
Hello, world! <input type="button" value="Close" onclick="google.script.host.close()" />
</body>
</html>
I enabled the trigger for onEdit to get it to work and it works on the windows machine without issues but when run on the iPad I get:
Exception: You do not have permission to call Ui.showModalDialog. Required permissions: https://www.googleapis.com/auth/script.container.ui
So next I tried:
3.
function myFunction(){
Logger.log("myFun")
var html = HtmlService.createTemplateFromFile( 'Page' )
.evaluate()
.setWidth( 800 )
.setHeight( 400 );
SpreadsheetApp.getUi() // Or DocumentApp or FormApp.
.showModalDialog( html, 'My page title' );
}
function onEdit(){
ScriptApp.newTrigger('myFunction')
.forSpreadsheet(SpreadsheetApp.getActive())
.onEdit()
.create();
}
Using the same page.html, this time in executions it looks like it runs but no box appears on the ipad(it does work on windows). I also tried spreadsheetApp.getUi().alert and prompt, these had the same results.
And Yes I have to use the iPad, I can not use another type of tablet.
Issue:
"Exception: You do not have permission to call Ui.showModalDialog. Required permissions: googleapis.com/auth/script.container.ui"
Fix:
What you can do is installing the trigger instead of using a simple trigger. The image below shows the difference between an installed (above) and a simple (below) trigger using the same code.
Output:
Note:
Don't use reserved function names on installed triggers to avoid it being executed twice like what's shown above. Change onEdit to something like promptUI or something else.
If the above fix isn't enough to show the dialog box, then we need to confirm if the issue might just be on the safari browser (if you are using one) since it worked on your other devices which I assumed are not using safari. You can try using an alternative browser in your device such as Google Chrome and see if the same issue persists. I recommended doing this since i'm seeing a number of issues between showModalDialog and safari
EDIT:
I have seen these related posts pointing out that there are some limitations on mobile apps. See the references below.
Also, some answers suggests that you need to access the spreadsheet via browser (google chrome desktop mode) and then trigger the script there.
References:
Add a script trigger to Google Sheet that will work in Android mobile app
google speadsheet api onOpen does not work on mobile ios
Executing Google Apps Script Functions from Mobile App
How to get scripts to work with phones and tablets

Foreign characters displaying delayed on cordova ios application

We are using Webfont Loader to load google fonts. And inside the active callback of WebFont.load we load our main script and bootstrap angular.js application.
<script type="text/javascript">
WebFontConfig = {
google: {
families: ['Open Sans:400,700,700i,400i:latin-ext']
},
active: function() {
var mainScript = document.createElement('script');
mainScript.src = "/js/main.js";
mainScript.onload = function() {
angular.bootstrap(document, ['cob']);
}
document.body.appendChild(mainScript);
}
};
WebFont.load(WebFontConfig);
</script>
To make browser use default fonts until the google font file loaded, we set fonts for .wf-active class
html.wf-active {
font-family: 'Open Sans', sans-serif;
}
Inside angular run, we switch apploaded and clear screen from loaders and show the application.
angular.module('mymodule')
.run([function() {
$rootScope.appLoaded = true;
}
]);
html
<body>
<div class="app-loader" ng-hide="appLoaded">loading...</div>
<div class="page-container" ng-if="appLoaded">
application loaded. <button>GİRİŞ</button>
</div>
</body>
We see "loading..." until the font files loaded, then application bootstraps successfully.
But the button text is rendered as "G R " for a couple of seconds, after a while 'İ' and 'Ş' characters are loaded into screen and we see GİRİŞ on button.
I am sure the font file is loaded before application bootstraps, because the font doesn't change after the application is loaded.
May be irrelevant but, I got some image files on the page and foreign characters are rendered with the image files. So there is some kind of a wierd screen render latency.
We only have this issue on iOS application, I have tested it on iPhone 6 and 6s, and on xcode simulators.
This works as intended on browsers (safari, chrome and firefox) and on android application we create with the same cordova project.
After trying various preload methods, just as I was considering to give it up, I came accross to a fact here
most browsers download fonts when they're used in a page rather than
when they're declared in CSS.
It seems like latin-ext subset of the font is delayed until it is used inside the page.
I have solved the issue by putting a dummy character (İ) that will make it download latin-ext subset on load screen

SECURITY_ERR: DOM Exception 18 on iOS 5.1 when upgrading app with WebView that opens local database

If you build a simple Titanium mobile application that contains a WebView which has in it javascript that opens a local database, the first time you install it to an iOS 5.1 device it will open the database correctly. However, if you then upgrade the app on the device (it can still be the exact same version/build), it will error when opening the local database:
SECURITY_ERR: DOM Exception 18
Steps to reproduce:
Add the app.js and database.html files below to the root of Resources.
Install app to iOS 5.1 device (Run > iOS Device in Ti Studio).
Open app, it will say "db opened".
Upgrade app on iOS 5.1 device (Run > iOS Device in Ti Studio).
Open app, it will say "db opening failed: Error: SECURITY_ERR: DOM Exception 18".
Here is the code to reproduce:
app.js:
var win = Ti.UI.createWindow({});
var webView = Ti.UI.createWebView({
top : 0, right : 0, bottom : 0, left : 0, url: 'database.html'
});
win.add(webView);
win.open();
database.html:
<!DOCTYPE HTML>
<html>
<head>
<title>db test</title>
<script>
window.onload = function () {
var dbConn;
try {
dbConn = openDatabase('test', '0.1', 'test database', 5 * 1024 * 1024);
alert('db opened');
} catch (e) {
alert('db opening failed: ' + e.toString());
}
};
</script>
</head>
<body>
db test
</body>
</html>
This issue seems to be the same as Apache Cordova has had and fixed.
https://issues.apache.org/jira/browse/CB-347
Has anyone else run into this issue? Any ideas for a work-around?
We ended up creating a custom webview module for iOS to fix the issue ourselves, as who knows how long it'll take before Titanium does the same:
Webview Module Source

Is JQuery UI meant to work only with Google Chrome??? (How about IE and Firefox??!)

I'm using "Jquery UI 1./Dan Wellman/Packt Publishing" to learn JQuery UI. I'm working on the 'Dialog widget' chapiter.
After I've completed a series of exercises in order to build a Dialog widget (using Google Chrome), I then tried my work with Internet Explorer and Firefox.
The result has been disappointing.
Chrome was perfet
With Internet Explorer, (1) the title of the Dialog widget did not appear, (2) The location of the dialog widget was not correct (given the position: ["center", "center"]). It was rather offset toward left.
With Firefox, the location was respected. However, only the outer container was visible. the content was missing, just a blank container.
Also using Option Show:true and Hide:true did only work with Chrome.
I wonder now if JQuery UI was meant to be used only with Google Chrome. I just think that I might be missing some directives to make it work with major browsers (as the author claimed in his book).
Here's the code. Since, I'm using ASP.NET MVC, certain codes, such as the element to the css, do not appear. But, for the rest, all the functioning code is bellow.
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<p>
The goal of this tutorial is to explain one method of creating
model classes for an ASP.NET MVC application. In this tutorial,
you learn how to build model classes and perform database access
by taking advantage of Microsoft LINQ to SQL. In this tutorial,
we build a basic Movie database application. We start by creating
the Movie database application in the fastest and easiest way possible.
We perform all of our data access directly from our controller actions.
</p>
<div style = "font-size:.7em" id = "myDialog" title = "This is the title">
In this tutorial -- in order to illustrate how you can build model classes
-- we build a simple Movie database application.
The first step is to create a new database. Right-click the
App_Data folder in the Solution Explorer window and select the menu option
Add, New Item. Select the SQL Server Database template, give it the name
MoviesDB.mdf, and click the Add button (see Figure 1).
</div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ScriptContent"
runat="server">
<script src="../../Content/development-bundle/jquery-1.3.2.js"
type="text/javascript"></script>
<script src="../../Content/development-bundle/ui/ui.core.js"
type="text/javascript"></script>
<script src="../../Content/development-bundle/ui/ui.dialog.js"
type="text/javascript"></script>
<script src="../../Content/development-bundle/ui/ui.draggable.js"
type="text/javascript"></script>
<script src="../../Content/development-bundle/ui/ui.resizable.js"
type="text/javascript"></script>
<script
src="../../Content/development-bundle/external/bgiframe/jquery.bgiframe.js"
type="text/javascript"></script>
<script type = "text/javascript">
$(function() {
var execute = function() { }
var cancel = function() { }
var dialogOpts = {
position: ["center", "center"],
title: '<a href="/Home/About">A link title!<a>',
modal: true,
minWidth: 500,
minHeight: 500,
buttons: {
"OK": execute,
"Cancel": cancel
},
show:true,
hide: true,
bgiframe:true
};
$("#myDialog").dialog(dialogOpts);
});
</script>
Thank for helping.
EDIT
I've re-done the same exercise yesterday. From the beginning to the end, each time I've introduced a behavior, I've tested my work in all 3 browsers (IE, Firefox, Chrome).
Everything works until I add option Show and Hide. Then only Chrome works.
If I remove Show and Hide, everything works again.
If I keep only Show and Hide, everything works perfectly
Maybe Show and Hide options for dialog widget do not mix up well with other options.
Thanks for helping.
No, jQuery UI works in any of those browsers. It's probably either the steps you're following don't work so well with the version you're using or the version you're using is old. I've used jQuery UI without issue on both browsers. If you don't believe me, then open this URL in your browser:
http://jqueryui.com/demos/dialog/
In Firefox 3.6, it loads just fine for me.
I'm not an expert on jQuery UI, but providing the code here might help.
jQuery supports all the major browsers however there are know issues with;
Firefox 1.0.x
Internet Explorer 1.0-5.x
Safari 1.0-2.0.1
Opera 1.0-8.x
Konqueror
We have successfully implemented a Dialog widget without major issues. We did have some problems making sure the correct versions of the libraries were created. I would suggest you build a custom file using the jQuery UI download tool. This will put all the necessary files in a single minified file.
If the Dialog examples don't help then posting code will be necessary to obtain further help.
EDIT:
I have anchors created with the classes dialogOpen and dialogClose and use the following code to utilise the created UI Dialog;
$(document).ready(function(){
var dialogOpts = {
autoOpen: false,
modal: true,
width: 840,
height: 560
};
$(".dialogOpen").click(function(){
$("#myDialog").dialog("open");
return false;
});
$(".dialogClose").click(function(){
$("#myDialog").dialog("close");
return false;
});
$("#myDialog").css('display','block').dialog(dialogOpts);
$(".ui-dialog-titlebar").hide();
});
NB: The use of the css function when creating the dialog stops the content appearing on the page before the Dialog is created. We needed this because our dialog has flash.
You may be missing something. It surely works in all major browsers.
jQuery is ment to be cross browser. Any errors with this can have to reasons
- Programmer's error
- Explicit incompatibilty
There are some explicit incompatibility's with IE5.5 and IE6 in jQuery. They are in the comments of jQuery and a good js compatible IDE like netbeans will allow targeting and warn you about it.
I never had any problems with the dialog widget positioning or contents.
jQuery UI is most definitly not designed to work with Google Chrome only.
I've successfully created applications using jQuery UI working on all major browser platforms.
jQuery UI (and jQuery) contain code to work around certain browser issues.
Of course there can be issues in jQuery UI which show on IE, like this one, but those are certainly not by design.

Resources