File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change 11'serviceWorker' in navigator &&
2- window . addEventListener ( 'load' , async function ( ) {
3- await navigator . serviceWorker . register ( '/sw.js' , { scope : '/' } )
4- //uv SW
5- await navigator . serviceWorker . register ( '/js/sw/uv.js' , { scope : '/js/sw/service/uv/' } )
6- //await navigator.serviceWorker.register('/js/sw/dynamic.js', { scope: '/js/sw/service/dynamic/' })
7- //await setDefaultTransport();
8- } ) ;
2+ //window.addEventListener('load', function () {
3+ navigator . serviceWorker . register ( '/sw.js' , { scope : '/' } )
4+ //uv SW
5+ navigator . serviceWorker . register ( '/js/sw/uv.js' , { scope : '/js/sw/service/uv/' } ) . then (
6+ function ( registration ) {
7+ console . log ( "UV SW Registered!" ) ;
8+ setDefaultTransport ( ) ;
9+ } ) . catch ( function ( error ) {
10+ console . log ( "UV SW Registration failed: " , error ) ;
11+ } ) ;
912function regSW ( ) {
1013 'serviceWorker' in navigator &&
1114 navigator . serviceWorker . register ( '/sw.js' , { scope : '/' } )
You can’t perform that action at this time.
0 commit comments