File tree Expand file tree Collapse file tree 2 files changed +9
-17
lines changed Expand file tree Collapse file tree 2 files changed +9
-17
lines changed Original file line number Diff line number Diff line change @@ -18,17 +18,14 @@ declare global {
1818function initServiceWorker ( ) {
1919 if ( "serviceWorker" in navigator ) {
2020 window . addEventListener ( "load" , ( ) => {
21- navigator . serviceWorker
22- // TODO: base url is required here. Hardcode for testing purposes.
23- . register ( "/service-worker/sw.js" , { scope : "/service-worker/" } )
24- . then (
25- function ( _registration ) {
26- console . log ( "Simulator ServiceWorker registration successful" ) ;
27- } ,
28- function ( err ) {
29- console . log ( "Simulator ServiceWorker registration failed: " , err ) ;
30- }
31- ) ;
21+ navigator . serviceWorker . register ( "sw.js" ) . then (
22+ function ( _registration ) {
23+ console . log ( "Simulator ServiceWorker registration successful" ) ;
24+ } ,
25+ function ( err ) {
26+ console . log ( "Simulator ServiceWorker registration failed: " , err ) ;
27+ }
28+ ) ;
3229 } ) ;
3330 }
3431}
Original file line number Diff line number Diff line change 11function initSimulatorServiceWorker ( ) {
2- const simUrls = [
3- // TODO: Fix more prefix hacks
4- "/service-worker/simulator.html" ,
5- "/service-worker/build/simulator.js" ,
6- "/service-worker/build/firmware.js" ,
7- ] ;
2+ const simUrls = [ "simulator.html" , "build/simulator.js" , "build/firmware.js" ] ;
83 let didInstall = false ;
94 const cacheName = "simulator" ;
105
You can’t perform that action at this time.
0 commit comments