Skip to content

Commit eb99a78

Browse files
authored
1 parent 8fcdf4e commit eb99a78

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

src/vs/base/browser/defaultWorkerFactory.ts

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,20 @@ export function getWorkerBootstrapUrl(scriptPath: string, label: string): string
4343
return URL.createObjectURL(blob);
4444
}
4545

46-
const result = new URL(scriptPath);
47-
COI.addSearchParam(result.searchParams, true, true);
48-
result.hash = label;
49-
return result.href;
50-
46+
const start = scriptPath.lastIndexOf('?');
47+
const end = scriptPath.lastIndexOf('#', start);
48+
const params = start > 0
49+
? new URLSearchParams(scriptPath.substring(start + 1, ~end ? end : undefined))
50+
: new URLSearchParams();
51+
52+
COI.addSearchParam(params, true, true);
53+
const search = params.toString();
54+
55+
if (!search) {
56+
return `${scriptPath}#${label}`;
57+
} else {
58+
return `${scriptPath}?${params.toString()}#${label}`;
59+
}
5160
}
5261
// ESM-comment-end
5362

0 commit comments

Comments
 (0)