diff --git a/src/vs/base/common/network.ts b/src/vs/base/common/network.ts index b00899c50db95..e37d87f4e67e9 100644 --- a/src/vs/base/common/network.ts +++ b/src/vs/base/common/network.ts @@ -289,10 +289,12 @@ export const FileAccess = new FileAccessImpl(); export namespace COI { + const coepDefault = platform.isElectron ? 'credentialless' : 'require-corp'; + const coiHeaders = new Map<'3' | '2' | '1' | string, Record>([ ['1', { 'Cross-Origin-Opener-Policy': 'same-origin' }], - ['2', { 'Cross-Origin-Embedder-Policy': 'require-corp' }], - ['3', { 'Cross-Origin-Opener-Policy': 'same-origin', 'Cross-Origin-Embedder-Policy': 'require-corp' }], + ['2', { 'Cross-Origin-Embedder-Policy': coepDefault }], + ['3', { 'Cross-Origin-Opener-Policy': 'same-origin', 'Cross-Origin-Embedder-Policy': coepDefault }], ]); export const CoopAndCoep = Object.freeze(coiHeaders.get('3')); diff --git a/src/vs/platform/environment/common/argv.ts b/src/vs/platform/environment/common/argv.ts index 2bbfd487d7546..5b43d16495e00 100644 --- a/src/vs/platform/environment/common/argv.ts +++ b/src/vs/platform/environment/common/argv.ts @@ -111,7 +111,7 @@ export interface NativeParsedArgs { 'profile-temp'?: boolean; 'disable-chromium-sandbox'?: boolean; - 'enable-coi'?: boolean; + 'disable-coi'?: boolean; // chromium command line args: https://electronjs.org/docs/all#supported-chrome-command-line-switches 'no-proxy-server'?: boolean; diff --git a/src/vs/platform/environment/electron-main/environmentMainService.ts b/src/vs/platform/environment/electron-main/environmentMainService.ts index 1fd54c5997b52..a7e03ab240358 100644 --- a/src/vs/platform/environment/electron-main/environmentMainService.ts +++ b/src/vs/platform/environment/electron-main/environmentMainService.ts @@ -63,7 +63,7 @@ export class EnvironmentMainService extends NativeEnvironmentService implements get disableKeytar(): boolean { return !!this.args['disable-keytar']; } @memoize - get crossOriginIsolated(): boolean { return !!this.args['enable-coi']; } + get crossOriginIsolated(): boolean { return !this.args['disable-coi']; } @memoize get codeCachePath(): string | undefined { return process.env['VSCODE_CODE_CACHE_PATH'] || undefined; } diff --git a/src/vs/platform/environment/node/argv.ts b/src/vs/platform/environment/node/argv.ts index fbae6c3e4ed81..422fa2ce240b0 100644 --- a/src/vs/platform/environment/node/argv.ts +++ b/src/vs/platform/environment/node/argv.ts @@ -164,7 +164,7 @@ export const OPTIONS: OptionDescriptions> = { 'continueOn': { type: 'string' }, 'locate-shell-integration-path': { type: 'string', args: ['bash', 'pwsh', 'zsh', 'fish'] }, - 'enable-coi': { type: 'boolean' }, + 'disable-coi': { type: 'boolean' }, // chromium flags 'no-proxy-server': { type: 'boolean' },