blob: f5d0367877a42a561fbcb937acfa52b60cabaa0b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
<!DOCTYPE html>
<meta charset="utf-8"/>
<script>
async function onLoad() {
const params = new URLSearchParams(self.location.search);
const scope = self.origin + params.get('scopepath');
const reg = await navigator.serviceWorker.getRegistration(scope);
if (reg) {
await reg.unregister();
}
if (window.opener) {
window.opener.postMessage({ type: 'SW-UNREGISTERED' }, '*');
} else {
window.top.postMessage({ type: 'SW-UNREGISTERED' }, '*');
}
}
self.addEventListener('load', onLoad);
</script>
|