Skip to content

Commit

Permalink
Revert "enable COI for desktop via coep: credentialless, change com…
Browse files Browse the repository at this point in the history
…mand line flag from "enable-coi" to "disable-coi" (microsoft#186720)" (microsoft#187047)

This reverts commit eafde5a.
  • Loading branch information
jrieken authored Jul 5, 2023
1 parent 3b9f282 commit 8940685
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
6 changes: 2 additions & 4 deletions src/vs/base/common/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,12 +289,10 @@ export const FileAccess = new FileAccessImpl();

export namespace COI {

const coepDefault = platform.isElectron ? 'credentialless' : 'require-corp';

const coiHeaders = new Map<'3' | '2' | '1' | string, Record<string, string>>([
['1', { 'Cross-Origin-Opener-Policy': 'same-origin' }],
['2', { 'Cross-Origin-Embedder-Policy': coepDefault }],
['3', { 'Cross-Origin-Opener-Policy': 'same-origin', 'Cross-Origin-Embedder-Policy': coepDefault }],
['2', { 'Cross-Origin-Embedder-Policy': 'require-corp' }],
['3', { 'Cross-Origin-Opener-Policy': 'same-origin', 'Cross-Origin-Embedder-Policy': 'require-corp' }],
]);

export const CoopAndCoep = Object.freeze(coiHeaders.get('3'));
Expand Down
2 changes: 1 addition & 1 deletion src/vs/platform/environment/common/argv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export interface NativeParsedArgs {
'profile-temp'?: boolean;
'disable-chromium-sandbox'?: boolean;

'disable-coi'?: boolean;
'enable-coi'?: boolean;

// chromium command line args: https://electronjs.org/docs/all#supported-chrome-command-line-switches
'no-proxy-server'?: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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['disable-coi']; }
get crossOriginIsolated(): boolean { return !!this.args['enable-coi']; }

@memoize
get codeCachePath(): string | undefined { return process.env['VSCODE_CODE_CACHE_PATH'] || undefined; }
Expand Down
2 changes: 1 addition & 1 deletion src/vs/platform/environment/node/argv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export const OPTIONS: OptionDescriptions<Required<NativeParsedArgs>> = {
'continueOn': { type: 'string' },
'locate-shell-integration-path': { type: 'string', args: ['bash', 'pwsh', 'zsh', 'fish'] },

'disable-coi': { type: 'boolean' },
'enable-coi': { type: 'boolean' },

// chromium flags
'no-proxy-server': { type: 'boolean' },
Expand Down

0 comments on commit 8940685

Please sign in to comment.