Run with or without sandbox

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

@ -19,18 +19,28 @@ customElements.define(
) )
class Setup { class Setup {
async run() { async runWithSw() {
const sw = navigator.serviceWorker navigator.serviceWorker.addEventListener(
'controllerchange',
sw.addEventListener('controllerchange', () => { () => {
if (this.registration.active) { if (this.registration.active) {
window.location.reload(true) window.location.reload(true)
} }
}) }
)
await this.register() await this.register()
this.load() this.load()
} }
async runWithoutSw() {
const layout = document.createElement(
'm-layout'
)
layout.csp = undefined
layout.header.menu.handleLinks = true
document.body.appendChild(layout)
}
async register() { async register() {
try { try {
this.registration = this.registration =
@ -54,4 +64,4 @@ class Setup {
} }
} }
new Setup().run() new Setup().runWithSw()
Loading…
Cancel
Save