I am experimenting with Php desktop, and so far all is great. How ever I need to be able to have a button that will make it go to fullcreen and out (not only maximalized). Is there a way to do it? Or is there a way to start the aplication in browser?
Asked
Active
Viewed 2,185 times
2 Answers
2
PHP desktop basically uses a browser (IE or Chrome). You can therefore use Javascript to go full screen. Like this:
<button id="goFS">Go fullscreen</button>
<script>
var goFS = document.getElementById("goFS");
goFS.addEventListener("click", function() {
document.body.requestFullscreen();
}, false);
</script>
For more details see: https://developers.google.com/web/fundamentals/native-hardware/fullscreen/

KIKO Software
- 15,283
- 3
- 18
- 33
-
Sadly, I have traied, this does not work, at least not on win 10 – Daniel Kolář Feb 23 '18 at 20:22
-
How about this link: https://github.com/cztomczak/phpdesktop/blob/master/phpdesktop-chrome47/www/javascript-api.php – KIKO Software Feb 23 '18 at 20:35
-
I am sorry I forgot to answer. The link works perfectly! Thanks – Daniel Kolář Mar 30 '18 at 13:21
2
PHP Desktop exposes API to javascript under the "window.phpdesktop" object. To go full screen call phpdesktop.ToggleFullscreen()
, to undo call it again.
See example:
See docs:

Czarek Tomczak
- 20,079
- 5
- 49
- 56