0

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?

2 Answers2

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
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:

https://github.com/cztomczak/phpdesktop/blob/2a800fecd8830e4f1e6c4054e74e8d03b4900847/phpdesktop-chrome57/www/javascript-api.php

See docs:

https://github.com/cztomczak/phpdesktop/wiki/Javascript-API

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