From 82162c3c5ebbd4ba33295a7579bfc5b325ee9563 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Wed, 20 May 2020 15:58:28 +0200 Subject: [PATCH] Apply fullscreen to document.documentElement instead of getting the body --- platypush/backend/http/static/js/utils.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/platypush/backend/http/static/js/utils.js b/platypush/backend/http/static/js/utils.js index c3465ed9..6f026239 100644 --- a/platypush/backend/http/static/js/utils.js +++ b/platypush/backend/http/static/js/utils.js @@ -1,13 +1,13 @@ function enterFullScreen() { - const body = document.getElementsByTagName('body')[0]; - if (body.requestFullscreen()) { - return body.requestFullscreen(); - } else if (body.msRequestFullscreen()) { - return body.msRequestFullscreen(); - } else if (body.mozRequestFullScreen()) { - return body.mozRequestFullScreen(); - } else if (body.webkitRequestFullscreen()) { - return body.webkitRequestFullscreen(); + const app = document.documentElement; + if (app.requestFullscreen()) { + return app.requestFullscreen(); + } else if (app.msRequestFullscreen()) { + return app.msRequestFullscreen(); + } else if (app.mozRequestFullScreen()) { + return app.mozRequestFullScreen(); + } else if (app.webkitRequestFullscreen()) { + return app.webkitRequestFullscreen(); } else { console.warn('This browser does not support fullscreen mode'); }