2020 if ( 'serviceWorker' in navigator ) {
2121 await navigator . serviceWorker . register ( '/sw.js' , {
2222 scope : '/sw/' ,
23- } ) . then ( updateTransport ) ;
23+ } ) . then ( ( ) => {
24+ BareMux . registerRemoteListener ( navigator . serviceWorker . controller ) ;
25+ let transport = localStorage . getItem ( 'transport' ) || "EpxMod.EpoxyClient"
26+ // Feel free to remove this, its just for skids to stop making issues on it
27+ if ( window . location . origin . includes ( '.pages.dev' ) ) {
28+ console . log ( 'your static hosting, using TOMP Wisp Server.' )
29+ let wispserver = "wss://tomp.app/wisp"
30+ BareMux . SetTransport ( transport , { wisp : wispserver } ) ;
31+ } else {
32+ console . log ( 'Using Backend Wisp Server, if your static hosting just delete these lines bellow and uncomment out the text bellow' )
33+ //let wispserver = "wss://tomp.app/wisp" Uncomment if static hosting
34+ let wispserver = `${ window . location . origin . replace ( / ^ h t t p s ? : \/ \/ / , 'ws://' ) } /wisp/`
35+ BareMux . SetTransport ( transport , { wisp : wispserver } ) ;
36+ }
37+ } ) ;
2438
2539 await navigator . serviceWorker . register ( '/dynsw.js' , {
2640 scope : '/dyn/' ,
3347 window . location . reload ( )
3448 }
3549 } ) ( ) ;
36-
37- async function updateTransports ( ) {
38- BareMux . registerRemoteListener ( navigator . serviceWorker . controller ) ;
39- let transport = localStorage . getItem ( 'transport' ) || "EpxMod.EpoxyClient"
40- // Feel free to remove this, its just for skids to stop making issues on it
41- if ( window . location . origin . includes ( '.pages.dev' ) ) {
42- console . log ( 'your static hosting, using TOMP Wisp Server.' )
43- let wispserver = "wss://tomp.app/wisp"
44- BareMux . SetTransport ( transport , { wisp : wispserver } ) ;
45- } else {
46- console . log ( 'Using Backend Wisp Server, if your static hosting just delete these lines bellow and uncomment out the text bellow' )
47- //let wispserver = "wss://tomp.app/wisp" Uncomment if static hosting
48- let wispserver = `${ window . location . origin . replace ( / ^ h t t p s ? : \/ \/ / , 'ws://' ) } /wisp/`
49- BareMux . SetTransport ( transport , { wisp : wispserver } ) ;
50- }
51- }
5250 </ script >
5351 </ head >
5452 < body tabindex ="-1 " oncontextmenu ="return false; " class ="noSelect " id ="no " data-notification ="false ">
@@ -307,4 +305,4 @@ <h5 class="timeT" id="time"></h5>
307305 < script src ="https://unpkg.com/draggabilly@2.2.0/dist/draggabilly.pkgd.min.js "> </ script >
308306 < noscript style ="position: absolute; "> ENABLE JAVASCRIPT!! Thanks!</ noscript >
309307 </ body >
310- </ html >
308+ </ html >
0 commit comments