Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix https://github.com/microsoft/vscode/issues/161394 #162213

Merged
merged 1 commit into from Sep 28, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 14 additions & 5 deletions src/vs/base/browser/defaultWorkerFactory.ts
Expand Up @@ -43,11 +43,20 @@ export function getWorkerBootstrapUrl(scriptPath: string, label: string): string
return URL.createObjectURL(blob);
}

const result = new URL(scriptPath);
COI.addSearchParam(result.searchParams, true, true);
result.hash = label;
return result.href;

const start = scriptPath.lastIndexOf('?');
const end = scriptPath.lastIndexOf('#', start);
const params = start > 0
? new URLSearchParams(scriptPath.substring(start + 1, ~end ? end : undefined))
: new URLSearchParams();

COI.addSearchParam(params, true, true);
const search = params.toString();

if (!search) {
return `${scriptPath}#${label}`;
} else {
return `${scriptPath}?${params.toString()}#${label}`;
}
}
// ESM-comment-end

Expand Down