on 08-25-2016 11:41 AM
Hi experts,
is there a simple, working way to detect in scripting whether the current session is rendered by web browser or through Windows GUI?
We'd like to show e.g. a warning to users in case of using Windows GUI, that some of the features are not supported / working in our flavors.
Thanks for any advice!
Hi Merten,
You can use the following API to detect the GUI used:
session.info.guiType
guiType | Number | r | Provides the GUI runtime in which the current script is executed. Values are:
|
The API documentation can be found on the server using the following URL:
http(s)://<host>:<port>/sap/bc/personas3/core/resources/doc/PersonasScriptingAPIDoc.html#GuiSessionInfo-prop-guiType
Best regards
Kranthi
SAP Screen Personas Team
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, excellent tip!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Merten,
The largest browsers working are chrome, Mozilla, Safari, Internet Explorer, Edge, Opera you can check for these browsers and display the message accordingly, try using the below code.
//Check for various browsers
var check_chrome = !!window.chrome && !!window.chrome.webstore;
var check_firefox = typeof InstallTrigger !== 'undefined';
var check_safari = Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0;
var check_IE = !!document.documentMode;
var check_edge = !check_IE && !!window.StyleMedia;
var check_opera = (!!window.opr && !!opr.addons) || !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0;
//Display Alert
if (check_chrome || check_firefox || check_safari || check_IE || check_edge || check_opera)
{
alert("opened from browser!");
}
else
{
alert("opened from windows GUI");
}
Regards,
Vigneshkkar.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.