// JavaScript
function btnChrome_onclick() {
document.documentElement.webkitRequestFullScreen();
}
This works on both the Desktop and Android devices.
To use it, add a button to your app with the following code:
// JavaScript
function btnChrome_onclick() {
document.documentElement.webkitRequestFullScreen();
}
' Basic
Function btnChrome_onclick()
document.documentElement.webkitRequestFullScreen()
End Function
After going to full screen, a message is displayed telling how to go back: swipe down on an Android device or hit escape on the desktop.
Here's how it looks in action.
If you want to execute some code after the resize (perhaps to move controls to take advantage of the larger screen, do the following:
// JavaScript
function window_onresize() {
console.log('resize')
// … do any housekeeping
}
' Basic
Function window_onresize()
Print "resize"
'… do any housekeeping
End Function
If you want hide the button if you are not using Chrome, add this code to your global code:
// JavaScript
if (!window.chrome) btnChrome.hide();
' Basic
If Not window.chrome Then btnChrome.hide()
A few gotchas:
Built-in Fullscreen Mode in Chrome for Android
Alternatively, any AppStudio web app can run in fullscreen mode on Chrome for Android by opening the app in the browser, then:
This is a newer Chrome feature than the first method described above and is typically the preferable option.