From c47addc973af1a685dfa39ed1e484df85a02e306 Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 21 Nov 2017 10:01:00 +0900 Subject: #934 --- src/web/app/common/mios.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/web/app/common') diff --git a/src/web/app/common/mios.ts b/src/web/app/common/mios.ts index cf7841d848..838be9c370 100644 --- a/src/web/app/common/mios.ts +++ b/src/web/app/common/mios.ts @@ -52,9 +52,20 @@ export default class MiOS extends EventEmitter { */ private swRegistration: ServiceWorkerRegistration = null; - constructor() { + /** + * Whether should register ServiceWorker + */ + private shouldRegisterSw: boolean; + + /** + * MiOSインスタンスを作成します + * @param shouldRegisterSw ServiceWorkerを登録するかどうか + */ + constructor(shouldRegisterSw = false) { super(); + this.shouldRegisterSw = shouldRegisterSw; + //#region BIND this.log = this.log.bind(this); this.logInfo = this.logInfo.bind(this); @@ -170,7 +181,7 @@ export default class MiOS extends EventEmitter { //#region Post // Init service worker - this.registerSw(); + if (this.shouldRegisterSw) this.registerSw(); //#endregion }; -- cgit v1.2.3-freya