File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ const RUNTIME = 'runtime';
1111const HOSTNAME_WHITELIST = [
1212 self . location . hostname ,
1313 "huangxuan.me" ,
14+ "yanshuo.io" ,
1415 "cdnjs.cloudflare.com"
1516]
1617
@@ -53,6 +54,7 @@ self.addEventListener('activate', event => {
5354 */
5455self . addEventListener ( 'fetch' , event => {
5556 // Skip some of cross-origin requests, like those for Google Analytics.
57+ console . log ( "fetch" , event . request . url )
5658 if ( HOSTNAME_WHITELIST . indexOf ( new URL ( event . request . url ) . hostname ) > - 1 ) {
5759 // Stale-while-revalidate
5860 // similar to HTTP's stale-while-revalidate: https://www.mnot.net/blog/2007/12/12/stale
@@ -80,4 +82,10 @@ self.addEventListener('fetch', event => {
8082 } )
8183 ) ;
8284 }
83- } ) ;
85+ } ) ;
86+
87+
88+
89+ self . addEventListener ( 'foreighfetch' , event => {
90+ console . log ( "foreighfetch" , event . request . url )
91+ } )
You can’t perform that action at this time.
0 commit comments