Run with or without sandbox

file-group-page
bat 3 years ago
parent 144acaf332
commit 8ea5ad385f

@ -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()
new Setup().runWithSw()
Loading…
Cancel
Save