-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault_base_frame.html
42 lines (42 loc) · 1.25 KB
/
default_base_frame.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<script
type="text/javascript"
onload="loadImJoyRPCByQueryString().then((imjoyRPC)=>{imjoyRPC.waitForInitialization({target_origin: '*', enable_service_worker: false})})"
src="/imjoy-loader.js"
></script>
<script>
if ("serviceWorker" in navigator) {
// Register the worker and show the list of quotations.
if (!navigator.serviceWorker.controller) {
navigator.serviceWorker.oncontrollerchange = function() {
this.controller.onstatechange = function() {
if (this.state === "activated") {
console.log("Service worker (core) successfully activated.");
}
};
};
navigator.serviceWorker
.register("/service-worker.js")
.then(function(registration) {
console.log(
"Service worker (core) successfully registered, scope is:",
registration.scope
);
})
.catch(function(error) {
console.error(
"Service worker (core) registration failed, error:",
error
);
});
} else {
console.log("Service worker (core) was activated.");
}
} else {
console.log("Service workers are not supported.");
}
</script>
<style>
body {
overscroll-behavior: contain;
}
</style>