extract some COI handle into network-util, add --enable-coi command line flag and adopt in main handler

This commit is contained in:
Johannes
2022-09-02 12:21:10 +02:00
parent 653757b10d
commit 2aeb99b11d
9 changed files with 84 additions and 12 deletions

View File

@@ -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