fix: Set (blink) feature flags one time #884
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In Chrome feature flags are meant to be set a single time with each desired flag seperated by commas. In the case where there are multiple
enable-feature
switches only the last one is used. At least I'm pretty sure based on what I read online and looking at the Chromium source code, I believe each time anenable-feature
switch is seen it just overwrites the previously set value.Ex:
This PR essentially just stores the different the
enable-feature
switch values in a set instead of appending them immediately and at the end joins them together with commas and appends them. I extended this as well todisable-features
,enable-blink-features
, anddisable-blink-features
. I'm thinking of removing thedisable-blink-features
part, as Legcord doesn't set any flags on it. I was almost tempted to also add something forenable-hardware-overlays
as it's used in the performance preset, but I restrained as I felt there's not much usecase and I didn't want to add another thing to the Preset type.Unfortunately I had to stray into
flags.ts
to modify how the presets are applied to work with this, but I don't see how else I could have worked with it.I have only tested this locally on my Arch install and I've noticed no issues based off of VERY brief testing. It works with the
legcord-flags.conf
pattern Arch does.My workflow was mostly launching Legcord with --inspect and then using Chrome remote dev tools to run:
To see what the command line args were.
PS: I got hardware decoding working by following the same instructions for Chrome by doing
--ozone-platform-hint=auto --enable-features=AcceleratedVideoDecodeLinuxGL