mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
feat: add commandLine.removeSwitch (#30933)
* feat: add commandLine.removeSwitch In some cases apps may want to remove Chromium command line switches to avoid certain Chromium behaviors being used, E.g. remote-debugging-port or gpu-launcher * fix: add missing removeSwitch to app.ts Co-authored-by: Milan Burda <milan.burda@gmail.com>
This commit is contained in:
@@ -42,6 +42,11 @@ void AppendSwitch(const std::string& switch_string,
|
||||
command_line->AppendSwitch(switch_string);
|
||||
}
|
||||
|
||||
void RemoveSwitch(const std::string& switch_string) {
|
||||
auto* command_line = base::CommandLine::ForCurrentProcess();
|
||||
command_line->RemoveSwitch(switch_string);
|
||||
}
|
||||
|
||||
void AppendArg(const std::string& arg) {
|
||||
auto* command_line = base::CommandLine::ForCurrentProcess();
|
||||
|
||||
@@ -56,6 +61,7 @@ void Initialize(v8::Local<v8::Object> exports,
|
||||
dict.SetMethod("hasSwitch", &HasSwitch);
|
||||
dict.SetMethod("getSwitchValue", &GetSwitchValue);
|
||||
dict.SetMethod("appendSwitch", &AppendSwitch);
|
||||
dict.SetMethod("removeSwitch", &RemoveSwitch);
|
||||
dict.SetMethod("appendArgument", &AppendArg);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user