Skip to content

Commit 9e1ed04

Browse files
authored
Update client-channel.js
1 parent 6c77da5 commit 9e1ed04

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

worker/client-channel.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,26 @@
33
// service worker/client communication channel
44

55

6-
const ORIGIN_URL = self.location.origin;
7-
86
// internal paths
97
const 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

2223
const isSafari = /^((?!chrome|android).)*safari/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

Comments
 (0)