mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 11:08:51 +01:00
extract some COI handle into network-util, add --enable-coi command line flag and adopt in main handler
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { COI } from 'vs/base/common/network';
|
||||
import { globals } from 'vs/base/common/platform';
|
||||
import { IWorker, IWorkerCallback, IWorkerFactory, logOnceWebWorkerWarning } from 'vs/base/common/worker/simpleWorker';
|
||||
|
||||
@@ -41,7 +42,12 @@ export function getWorkerBootstrapUrl(scriptPath: string, label: string): string
|
||||
const blob = new Blob([js], { type: 'application/javascript' });
|
||||
return URL.createObjectURL(blob);
|
||||
}
|
||||
return scriptPath + '#' + label;
|
||||
|
||||
const result = new URL(scriptPath);
|
||||
COI.addSearchParam(result.searchParams, true, true);
|
||||
result.hash = label;
|
||||
return result.href;
|
||||
|
||||
}
|
||||
// ESM-comment-end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user