File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -6,20 +6,26 @@ export default null
66
77declare const self : ServiceWorkerGlobalScope ;
88
9- self . addEventListener ( 'install' , function ( e ) {
9+ // Stub to get self-destruct SW building.
10+ const noop = ( _v : any ) => { }
11+
12+ //@ts -expect-error -- value provided externally
13+ noop ( self . __WB_MANIFEST )
14+
15+ self . addEventListener ( 'install' , function ( e ) {
1016 self . skipWaiting ( ) ;
1117} ) ;
1218
13- self . addEventListener ( 'activate' , function ( e ) {
19+ self . addEventListener ( 'activate' , function ( e ) {
1420 self . registration . unregister ( )
15- . then ( function ( ) {
21+ . then ( function ( ) {
1622 return self . clients . matchAll ( ) ;
1723 } )
18- . then ( function ( clients ) {
24+ . then ( function ( clients ) {
1925 clients . forEach ( client => {
20- if ( 'navigate' in client && typeof client . navigate === 'function' ) {
26+ if ( client instanceof WindowClient ) {
2127 client . navigate ( client . url )
2228 }
23- } )
29+ } )
2430 } ) ;
2531} ) ;
You can’t perform that action at this time.
0 commit comments