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

Add EXTRA_FLAGS for extended flag support #160

Merged
merged 1 commit into from
Oct 24, 2023

Conversation

bbugh
Copy link
Contributor

@bbugh bbugh commented Oct 20, 2023

This adds a new environment variable EXTRA_FLAGS so we can extend the existing flags passed to Chromium instead of clobbering them all with FLAGS and trying to reproduce the whole list ourselves.

For example, for our IoT project we need --audio-buffer-size=2048 and --audio-output-channels=8, so we can do this:

services:
  browser:
    image: bh.cr/balenalabs/browser-<arch>
    environment:
      EXTRA_FLAGS: --audio-buffer-size=2048 --audio-output-channels=8

instead of having this monstrosity (which requires us to keep track of window sizes):

services:
  browser:
    image: bh.cr/balenalabs/browser-<arch>
    environment:
      FLAGS: >-
        --disable-features=TranslateUI
        --disable-component-extensions-with-background-pages
        --disable-background-networking
        --disable-sync
        --metrics-recording-only
        --disable-default-apps
        --no-default-browser-check
        --no-first-run
        --disable-backgrounding-occluded-windows
        --disable-renderer-backgrounding
        --disable-background-timer-throttling
        --force-fieldtrials=*BackgroundTracing/default/
        --window-size=1920,1080
        --window-position=0,0
        --autoplay-policy=no-user-gesture-required
        --noerrdialogs
        --disable-session-crashed-bubble
        --check-for-update-interval=31536000
        --disable-dev-shm-usage
        --enable-zero-copy
        --num-raster-threads=4
        --ignore-gpu-blocklist
        --enable-gpu-rasterization
        --audio-buffer-size=2048
        --audio-output-channels=8

@bbugh
Copy link
Contributor Author

bbugh commented Oct 20, 2023

Force pushed change-type: minor amend to the message for the CI.

Copy link
Contributor

@phil-d-wilson phil-d-wilson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@phil-d-wilson phil-d-wilson merged commit a976bd0 into balena-io-experimental:master Oct 24, 2023
49 checks passed
@bbugh bbugh deleted the extra-flags branch October 26, 2023 16:51
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

Successfully merging this pull request may close these issues.

2 participants