Skip to content

Commit 1e7cd98

Browse files
committed
Check if hidden is available first
1 parent b90d7b2 commit 1e7cd98

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/core/Stage.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,11 @@ Phaser.Stage.prototype.updateTransform = function () {
226226
*/
227227
Phaser.Stage.prototype.checkVisibility = function () {
228228

229-
if (document.webkitHidden !== undefined)
229+
if (document.hidden !== undefined)
230+
{
231+
this._hiddenVar = 'visibilitychange';
232+
}
233+
else if (document.webkitHidden !== undefined)
230234
{
231235
this._hiddenVar = 'webkitvisibilitychange';
232236
}
@@ -238,10 +242,6 @@ Phaser.Stage.prototype.checkVisibility = function () {
238242
{
239243
this._hiddenVar = 'msvisibilitychange';
240244
}
241-
else if (document.hidden !== undefined)
242-
{
243-
this._hiddenVar = 'visibilitychange';
244-
}
245245
else
246246
{
247247
this._hiddenVar = null;

0 commit comments

Comments
 (0)