Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support chrome 'flags' and all command line options? #18253

Closed
3 tasks done
burtonator opened this issue May 10, 2019 · 9 comments
Closed
3 tasks done

Support chrome 'flags' and all command line options? #18253

burtonator opened this issue May 10, 2019 · 9 comments

Comments

@burtonator
Copy link

Preflight Checklist

  • I have read the Contributing Guidelines for this project.
  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for a feature request that matches the one I want to file, without success.

Problem Description

I'd like to have more control over the chrome renderer including flags and command line options.

There are experimental features of chrome I would like to play with.

These can be accessed in a browser as chrome://flags but this URL doesn't work with Electron.

Additionally there are command line arguments I'd like to specify like '--disable-site-isolation-trials' which would allow me to work around a bug that impact Electron right now.

@burtonator
Copy link
Author

Looks like it 'might' be able to do this now with --enable-feature= but I don't have a list of features to test it out with.

@MarshallOfSound
Copy link
Member

Chrome features that are flagged can be enabled / disabled with --enable-features and --disable-features.

Other cli flags can also be provided. You do both of these through the command line API

https://github.com/electron/electron/blob/master/docs/api/command-line.md

@mingjun97
Copy link

I'm trying to manupilate these two flags inside Chrome, but it seems that these flags don't have corresponding cli flags. The flags I've encontered are enable-media-session-service and hardware-media-key-handling. They can be changed by chrome://flags//#enable-media-session-service and chrome://flags//#hardware-media-key-handling How can I disable it?

I've searched it a lot but didn't find solution or workaround.

Thanks

@Pabloitto
Copy link

Any solution for this ?

@rocka
Copy link

rocka commented Feb 21, 2020

@mingjun97 in case you are still wandering, and someone searching for this issue, I found a workaround:

Open some task manager, you should be able to see many renderer processes of chrome, and their command lines, take a screenshot or copy one of those, especially enable-features and disable-features.

image

Then disable/enable desired flags in chrome, restart chrome, and copy those command line again:

image

In my case, It is HardwareMediaKeyHandling,MediaSessionService in disable-features.

Add them using

app.commandLine.appendSwitch('disable-features', 'HardwareMediaKeyHandling,MediaSessionService');

before app's ready event triggered. Works fine with electron 7.x and 8.x on Linux, which disable chromium's poor MPRIS implementation.

@Timmmm
Copy link

Timmmm commented Dec 15, 2020

You don't need to use the task manager - just go to chrome://version.

@aminya
Copy link

aminya commented Jan 11, 2021

How can I enable experimental web assembly features?

@parkerlreed
Copy link

parkerlreed commented Feb 1, 2023

Is there a way to pass this on the command line itself rather than in the source code?

I'm wanting to pass  --window-size=1024,640 --force-device-scale-factor=1.25 --device-scale-factor=1.25

Into an existing application but have been unsuccessful

@oalfroukh
Copy link

Chrome features that are flagged can be enabled / disabled with --enable-features and --disable-features.

Other cli flags can also be provided. You do both of these through the command line API

https://github.com/electron/electron/blob/master/docs/api/command-line.md

Hi @MarshallOfSound
Hope you're doing well!

Any idea how we can enable Chrome policy via the command line, for example, enable CloudAPAuthEnabled, or needs to request that as a feature to support it by electron itself?

Thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants