Skip to content

Commit

Permalink
fix #176284
Browse files Browse the repository at this point in the history
  • Loading branch information
meganrogge committed Apr 4, 2023
1 parent 3104a4e commit 68f61c1
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/vs/code/electron-main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,8 @@ class CodeMain {
args.waitMarkerFilePath = waitMarkerFilePath;
}
}

addArg(process.argv, '--autoplay-policy', 'no-user-gesture-required');
args['autoplay-policy'] = 'no-user-gesture-required';
return args;
}

Expand Down
1 change: 1 addition & 0 deletions src/vs/platform/environment/common/argv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export interface NativeParsedArgs {
'prof-duration-markers-file'?: string;
'prof-v8-extensions'?: boolean;
'no-cached-data'?: boolean;
'autoplay-policy'?: string;
verbose?: boolean;
trace?: boolean;
'trace-category-filter'?: string;
Expand Down
1 change: 1 addition & 0 deletions src/vs/platform/environment/common/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export interface IEnvironmentService {

// --- continue edit session
continueOn?: string;
autoplayPolicy?: string;
editSessionId?: string;

// --- extension development
Expand Down
4 changes: 4 additions & 0 deletions src/vs/platform/environment/common/environmentService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,10 @@ export abstract class AbstractNativeEnvironmentService implements INativeEnviron
this.args['continueOn'] = value;
}

get autoplayPolicy(): string | undefined {
return this._args['autoplay-policy'];
}

get args(): NativeParsedArgs { return this._args; }

constructor(
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 @@ -66,7 +66,6 @@ export const OPTIONS: OptionDescriptions<Required<NativeParsedArgs>> = {
}
}
},

'diff': { type: 'boolean', cat: 'o', alias: 'd', args: ['file', 'file'], description: localize('diff', "Compare two files with each other.") },
'merge': { type: 'boolean', cat: 'o', alias: 'm', args: ['path1', 'path2', 'base', 'result'], description: localize('merge', "Perform a three-way merge by providing paths for two modified versions of a file, the common origin of both modified versions and the output file to save merge results.") },
'add': { type: 'boolean', cat: 'o', alias: 'a', args: 'folder', description: localize('add', "Add folder(s) to the last active window.") },
Expand Down Expand Up @@ -190,6 +189,7 @@ export const OPTIONS: OptionDescriptions<Required<NativeParsedArgs>> = {
'_urls': { type: 'string[]' },
'disable-dev-shm-usage': { type: 'boolean' },
'profile-temp': { type: 'boolean' },
'autoplay-policy': { type: 'string' },

_: { type: 'string[]' } // main arguments
};
Expand Down
1 change: 1 addition & 0 deletions src/vs/platform/windows/electron-main/windowImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1085,6 +1085,7 @@ export class CodeWindow extends Disposable implements ICodeWindow {
configuration.isInitialStartup = false; // since this is a reload
configuration.policiesData = this.policyService.serialize(); // set policies data again
configuration.continueOn = this.environmentMainService.continueOn;
configuration['autoplay-policy'] = this.environmentMainService.autoplayPolicy;
configuration.profiles = {
all: this.userDataProfilesService.profiles,
profile: this.profile || this.userDataProfilesService.defaultProfile,
Expand Down

0 comments on commit 68f61c1

Please sign in to comment.