mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-14 17:41:33 +03:00
sw: move registration out of index.html
This commit is contained in:
parent
aefeea2d61
commit
1d69778225
4
pkg/interface/package-lock.json
generated
4
pkg/interface/package-lock.json
generated
@ -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",
|
||||
|
@ -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'));
|
||||
|
10
pkg/interface/src/register-sw.js
Normal file
10
pkg/interface/src/register-sw.js
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
|
||||
if ("serviceWorker" in navigator) {
|
||||
window.addEventListener("load", () => {
|
||||
navigator.serviceWorker.register("/~landscape/js/bundle/serviceworker.js", {
|
||||
scope: "/",
|
||||
}).then(reg => {
|
||||
});
|
||||
});
|
||||
}
|
Loading…
Reference in New Issue
Block a user