08-03-2020 10:46 AM
I have a web server running in a sbRIO-9603. I used LabVIEW 2019 for functionality and HTML/Javascript for HMI. I can pull HMI in google chrome and works great. The problem is, if someone uses Internet explorer, then some of the scripts are not supported in that, so the HMI doesn't function properly.
So what I want to do is, add few lines of Javascript code to identify the browser type. If it is IE, then automatically launch the same link in Chrome and close IE. I am using "ActiveXObject("WScript.Shell")" to do this. It works great when I tested the Javascript on my windows PC. But when I run this in sbRIO, it doesn't work. My guess is, this script runs in the sbRIO which is Linux based and ActiveX is not compatible with Linux. But I am new to this specific field of Javascript & HTML, I am learning on the go. Below is the Javascript that I have for switching the browsers. Any help that you can offer would be greatly appreciated. If there is an entirely different method (that doesn't use shell command) to accomplish this, please share with me.
08-04-2020 03:55 PM
Trying to have a web page launch an application is going to run afoul of security expectations.
A better approach would be to present a message to the user that informs them that their browser isn't supported, and to trigger that message on the functionality required rather than the browser version.
For example, here's a glitch that illustrates how to display a banner when a web app runs in a browser that does not support the modern es6 modules feature:
https://glitch.com/edit/#!/legacy-browser-banner?path=README.md