33// service worker/client communication channel
44
55
6- const ORIGIN_URL = self . location . origin ;
7-
86// internal paths
97const INTERNAL_PATHS = {
108
11- internal : ORIGIN_URL ,
9+ internal : 'https://codeit.codes/' ,
10+ internal_ : 'https://dev.codeit.codes/' ,
1211
13- run : ORIGIN_URL + '/run' ,
12+ run : 'https://codeit.codes/run' ,
13+ run_ : 'https://dev.codeit.codes/run' ,
1414
1515 relLivePath : ( '/run/' + '_/' . repeat ( 15 ) ) ,
1616
17- clientId : ORIGIN_URL + '/worker/getClientId'
17+ clientId : 'https://codeit.codes/worker/getClientId' ,
18+ clientId_ : 'https://dev.codeit.codes/worker/getClientId' ,
1819
1920} ;
2021
2122
2223const isSafari = / ^ ( (? ! c h r o m e | a n d r o i d ) .) * s a f a r i / i. test ( navigator . userAgent ) ;
2324
24- const isDev = ( ORIGIN_URL === 'https://dev.codeit.codes' ) ;
25+ const isDev = ( self . location . origin === 'https://dev.codeit.codes' ) ;
2526
2627
2728// key : value
@@ -38,7 +39,7 @@ function getPathType(path) {
3839
3940 if ( path . startsWith ( type [ 1 ] ) ) {
4041
41- pathType = type [ 0 ] ;
42+ pathType = type [ 0 ] . replaceAll ( '_' , '' ) ;
4243
4344 }
4445
@@ -294,4 +295,3 @@ self.addEventListener('fetch', (evt) => {
294295 evt . respondWith ( handleFetchRequest ( evt . request , evt ) ) ;
295296
296297} ) ;
297-
0 commit comments