1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2026-03-02 03:39:21 +00:00

Further firefox fixes

This commit is contained in:
tobspr
2020-05-25 12:15:52 +02:00
parent 4170874f3d
commit bf8b3253b9
4 changed files with 11 additions and 6 deletions

View File

@@ -228,6 +228,7 @@ export class Application {
* @param {Event} event
*/
handleVisibilityChange(event) {
window.focus();
const pageVisible = !document[pageHiddenPropName];
if (pageVisible !== this.pageVisible) {
this.pageVisible = pageVisible;
@@ -267,6 +268,7 @@ export class Application {
onAppRenderableStateChanged(renderable) {
logger.log("Application renderable:", renderable);
window.focus();
if (!renderable) {
this.stateMgr.getCurrentState().onAppPause();
} else {
@@ -326,6 +328,8 @@ export class Application {
this.ticker.frameEmitted.add(this.onFrameEmitted, this);
this.ticker.bgFrameEmitted.add(this.onBackgroundFrame, this);
this.ticker.start();
window.focus();
}
/**

View File

@@ -155,6 +155,7 @@ export class ClickDetector {
* @param {Event} event
*/
internalPreventClick(event) {
window.focus();
event.preventDefault();
}
@@ -301,6 +302,8 @@ export class ClickDetector {
* @param {TouchEvent|MouseEvent} event
*/
internalOnPointerDown(event) {
window.focus();
if (!this.internalEventPreHandler(event, 1)) {
return false;
}
@@ -369,6 +372,8 @@ export class ClickDetector {
* @param {TouchEvent|MouseEvent} event
*/
internalOnPointerEnd(event) {
window.focus();
if (!this.internalEventPreHandler(event, 0)) {
return false;
}

View File

@@ -28,10 +28,6 @@ export class PlatformWrapperImplBrowser extends PlatformWrapperInterface {
this.embedProvider.iframed = true;
this.embedProvider.iogLink = false;
logger.log("Running focus-fix automatically");
window.focus();
setInterval(() => window.focus(), 1000);
switch (providerId) {
case "armorgames": {
this.embedProvider.id = "armorgames";