FORUM CTRLX AUTOMATION
ctrlX World Partner Apps for ctrlX AUTOMATION
Dear Community User! We are updating our platform to a new
system.
Read more: Important
information on the platform change.
11-08-2023 10:05 AM - edited 11-08-2023 10:06 AM
Howto run Chromium browser in full-screen mode to achieve kiosk-like view on ctrlX HMI using Rexroth WR20x, WR21x web-panels?
Solved! Go to Solution.
11-08-2023 10:13 AM
@CodeShepherd Can you please move this to the correct "ctrlX HMI" forum?
11-08-2023 01:25 PM
You can use this UI-Action to toggle fullscreen via a button:
/**
* Custom UI-Action 'ToggleFullscreen'.
*
* Description:
* [Add description here]
*/
(function() {
var actions = shmi.pkg("visuals.session.userActions"); //get reference to userActions object
/**
* UI-Action 'ToggleFullscreen' implementation
*
* @params {any[]} parameters configured ui-action parameters
*
*/
actions["ToggleFullscreen"] = function(parameters) {
var element = document.body;
var isFullscreen = document.webkitIsFullScreen || document.mozFullScreen || false;
element.requestFullScreen = element.requestFullScreen || element.webkitRequestFullScreen || element.mozRequestFullScreen || function() {
return false;
};
document.cancelFullScreen = document.cancelFullScreen || document.webkitCancelFullScreen || document.mozCancelFullScreen || function() {
return false;
};
isFullscreen ? document.cancelFullScreen() : element.requestFullScreen();
};
}());
It's possible to add this to a LocalScript to toggle fullscreen on startup aswell.
11-08-2023 02:18 PM
Thanks Andreas, I will implement the solution; -let me ask you though, based on the code it starts in full-screen by default. Am I right?
11-08-2023 02:25 PM
Moved to corresponding forum "ctrlX HMI".
11-08-2023 03:14 PM - edited 11-08-2023 03:15 PM
This is a UI action which would be tied to a user interaction, so it would not toggle by default. I tried to call the UI action programmatically, in a local-script, to enable fullscreen on startup, but ran into this Javascript security measure...
Failed to execute 'requestFullscreen' on 'Element': API can only be initiated by a user gesture.
FYI the UI action is also a WebIQ specific solution.