sw: move registration out of index.html

This commit is contained in:
Liam Fitzgerald 2021-02-22 11:55:45 +10:00
parent aefeea2d61
commit 1d69778225
No known key found for this signature in database
GPG Key ID: D390E12C61D1CFFB
3 changed files with 15 additions and 1 deletions

View File

@ -1789,7 +1789,9 @@
}
},
"@urbit/eslint-config": {
"version": "1.0.0"
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/@urbit/eslint-config/-/eslint-config-1.0.0.tgz",
"integrity": "sha512-Xmzb6MvM7KorlPJEq/hURZZ4BHSVy/7CoQXWogsBSTv5MOZnMqwNKw6yt24k2AO/2UpHwjGptimaNLqFfesJbw=="
},
"big-integer": {
"version": "1.6.48",

View File

@ -1,6 +1,8 @@
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import './register-sw';
import App from './views/App';
ReactDOM.render(<App />, document.getElementById('root'));

View File

@ -0,0 +1,10 @@
if ("serviceWorker" in navigator) {
window.addEventListener("load", () => {
navigator.serviceWorker.register("/~landscape/js/bundle/serviceworker.js", {
scope: "/",
}).then(reg => {
});
});
}