Skip to content

Commit eafde5a

Browse files
authored
enable COI for desktop via coep: credentialless, change command line flag from "enable-coi" to "disable-coi" (microsoft#186720)
fixes microsoft#186614
1 parent 329cfd3 commit eafde5a

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

src/vs/base/common/network.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,10 +289,12 @@ export const FileAccess = new FileAccessImpl();
289289

290290
export namespace COI {
291291

292+
const coepDefault = platform.isElectron ? 'credentialless' : 'require-corp';
293+
292294
const coiHeaders = new Map<'3' | '2' | '1' | string, Record<string, string>>([
293295
['1', { 'Cross-Origin-Opener-Policy': 'same-origin' }],
294-
['2', { 'Cross-Origin-Embedder-Policy': 'require-corp' }],
295-
['3', { 'Cross-Origin-Opener-Policy': 'same-origin', 'Cross-Origin-Embedder-Policy': 'require-corp' }],
296+
['2', { 'Cross-Origin-Embedder-Policy': coepDefault }],
297+
['3', { 'Cross-Origin-Opener-Policy': 'same-origin', 'Cross-Origin-Embedder-Policy': coepDefault }],
296298
]);
297299

298300
export const CoopAndCoep = Object.freeze(coiHeaders.get('3'));

src/vs/platform/environment/common/argv.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export interface NativeParsedArgs {
111111
'profile-temp'?: boolean;
112112
'disable-chromium-sandbox'?: boolean;
113113

114-
'enable-coi'?: boolean;
114+
'disable-coi'?: boolean;
115115

116116
// chromium command line args: https://electronjs.org/docs/all#supported-chrome-command-line-switches
117117
'no-proxy-server'?: boolean;

src/vs/platform/environment/electron-main/environmentMainService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export class EnvironmentMainService extends NativeEnvironmentService implements
6363
get disableKeytar(): boolean { return !!this.args['disable-keytar']; }
6464

6565
@memoize
66-
get crossOriginIsolated(): boolean { return !!this.args['enable-coi']; }
66+
get crossOriginIsolated(): boolean { return !this.args['disable-coi']; }
6767

6868
@memoize
6969
get codeCachePath(): string | undefined { return process.env['VSCODE_CODE_CACHE_PATH'] || undefined; }

src/vs/platform/environment/node/argv.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ export const OPTIONS: OptionDescriptions<Required<NativeParsedArgs>> = {
164164
'continueOn': { type: 'string' },
165165
'locate-shell-integration-path': { type: 'string', args: ['bash', 'pwsh', 'zsh', 'fish'] },
166166

167-
'enable-coi': { type: 'boolean' },
167+
'disable-coi': { type: 'boolean' },
168168

169169
// chromium flags
170170
'no-proxy-server': { type: 'boolean' },

0 commit comments

Comments
 (0)