diff --git a/app.js b/app.js index aad8bcb..78bbbea 100644 --- a/app.js +++ b/app.js @@ -19,18 +19,28 @@ customElements.define( ) class Setup { - async run() { - const sw = navigator.serviceWorker - - sw.addEventListener('controllerchange', () => { - if (this.registration.active) { - window.location.reload(true) + async runWithSw() { + navigator.serviceWorker.addEventListener( + 'controllerchange', + () => { + if (this.registration.active) { + window.location.reload(true) + } } - }) + ) await this.register() this.load() } + async runWithoutSw() { + const layout = document.createElement( + 'm-layout' + ) + layout.csp = undefined + layout.header.menu.handleLinks = true + document.body.appendChild(layout) + } + async register() { try { this.registration = @@ -54,4 +64,4 @@ class Setup { } } -new Setup().run() \ No newline at end of file +new Setup().runWithSw() \ No newline at end of file