From 247da06882628b556230a11236457033dd23ac4f Mon Sep 17 00:00:00 2001 From: Carter David Henning Date: Fri, 30 Jul 2021 20:40:47 -0400 Subject: [PATCH 1/2] Fix incorrect fullscreen check --- plugins.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins.js b/plugins.js index 69b2ca3..51a84f1 100644 --- a/plugins.js +++ b/plugins.js @@ -4695,7 +4695,7 @@ GA.plugins = function(ga) { //to `fullscreen.scale`. If not, and the canvas hasn't already //been scaled, the scale reverts back to 1. ga.scaleFullscreen = function() { - if(document.fullscreenEnabled) { + if(document.fullscreenElement != null) { ga.scale = ga.fullscreenScale; ga.pointer.scale = ga.fullscreenScale; } else { From a997aa64ead6931d8eb39ab7e929fa44de17d83c Mon Sep 17 00:00:00 2001 From: Carter David Henning Date: Fri, 30 Jul 2021 21:15:51 -0400 Subject: [PATCH 2/2] Fix fullscreen display Fullscreen games now work properly with modern browsers. --- plugins.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins.js b/plugins.js index 51a84f1..8912d70 100644 --- a/plugins.js +++ b/plugins.js @@ -4556,7 +4556,7 @@ GA.plugins = function(ga) { //`requestFullscreen` is used by `enableFullscreen` to launch //fullscreen mode. ga.requestFullScreen = function() { - if (!document.fullscreenEnabled) { + if (document.fullscreenEnabled && document.fullscreenElement === null) { ga.canvas.requestFullscreen(); } }; @@ -4564,7 +4564,7 @@ GA.plugins = function(ga) { //`exitFullscreen` is used by `enableFullscreen` to exit //fullscreen mode. ga.exitFullScreen = function() { - if (document.fullscreenEnabled) { + if (document.fullscreenEnabled && document.fullscreenElement !== null) { document.exitFullscreen(); } };