File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed
Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change 11var preCacheName = 'pre_cache'
22var commonCacheName = 'common_cache'
33var preCacheFiles = [ ]
4- var version = "0.29.22"
4+ var version = "0.29.22.0 "
55
66var cacheRules = {
77 whiteList : [ ] ,
8- blockList : [ 'worker-register.js' ] ,
8+ blockList : [ ] ,
99}
10+
11+ /**基础工具*/
1012var util = {
1113 checkIsDocument : function ( request ) {
1214 return request . destination === 'document'
@@ -67,7 +69,7 @@ var util = {
6769 }
6870 }
6971
70- /**静态资源,可安全使用缓存*/
72+ /**静态资源,非API请求 ,可安全使用缓存*/
7173 var isStatic = / \. ( j s | c s s | p n g | j p g | s v g | w o f f | j p e g ) / . test ( request . url )
7274 var isDoucment = util . checkIsDocument ( request )
7375 if ( isStatic || isDoucment ) {
Original file line number Diff line number Diff line change 11function registerMain ( ) {
2- if ( window . location . hostname === 'localhost' ) {
3- return
4- }
52 navigator . serviceWorker
63 . register ( '/sw.js' )
74 . then ( function ( registration ) {
You can’t perform that action at this time.
0 commit comments