diff --git a/src/components/apphost.js b/src/components/apphost.js index 93e1dbd02c..56e9c93521 100644 --- a/src/components/apphost.js +++ b/src/components/apphost.js @@ -436,16 +436,14 @@ define(["appSettings", "browser", "events", "htmlMediaHelper", "webSettings"], f visibilityChange = "webkitvisibilitychange"; } - if (self.document) { - document.addEventListener(visibilityChange, function () { - /* eslint-disable-next-line compat/compat */ - if (document[hidden]) { - onAppHidden(); - } else { - onAppVisible(); - } - }, false); - } + document.addEventListener(visibilityChange, function () { + /* eslint-disable-next-line compat/compat */ + if (document[hidden]) { + onAppHidden(); + } else { + onAppVisible(); + } + }, false); if (self.addEventListener) { self.addEventListener("focus", onAppVisible);