Skip to content

Feature/configurable browser flags #269

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

Conversation

Worthingtravis
Copy link
Contributor

🚀 Feature: Browser Flag Customization

Overview

This PR adds an excludeBrowserFlags option that lets developers disable individual default Chromium flags when running Extension.js. It resolves #252, enabling easier testing of scrollbars, audio, and other features impacted by default flags.


Background

Extension.js starts browsers with a set of flags that streamline extension development, but a few of them can block key scenarios:

Default flag Impact on testing
--hide-scrollbars Hides scrollbars → hard to verify scrolling/overflow UI
--mute-audio Silences all sound → impossible to test audio features

Usage Example

// extension.config.js
module.exports = {
  browser: {
    chrome: {
      // ⛔️ Remove specific defaults
      excludeBrowserFlags: [
        '--hide-scrollbars', // show scrollbars for UI tests
        '--mute-audio'       // enable audio for media tests
      ],
  // ✅ Add your own flags as before
  browserFlags: [
    '--autoplay-policy=no-user-gesture-required'
  ]
}

}
};


Compatibility & Testing ✅

  • Backward-compatible – no breaking changes

  • Verified on Chrome, Firefox, Edge (Manifest V2 & V3)

  • No measurable performance impact during launch or reload


Benefits

  • Better DX – test scroll & audio natively, no hacks

  • Cleaner workflow – delete post-install flag‐removal scripts

  • Type-safe – full TS support & autocompletion

  • Extensible – pattern can cover more defaults later


Closes

Closes #252

This commit adds the ability to exclude specific default browser flags from the Chromium browser configuration. It introduces a new 'excludeBrowserFlags' option to the PluginInterface, along with a DefaultBrowserFlags type for better type safety and documentation. An example extension is included to demonstrate the feature.
…on interfaces

This commit modifies the 'dev' script in the browser-flags-example package.json for consistency. Additionally, it introduces the 'excludeBrowserFlags' property to the BrowserConfig and FileConfig interfaces, enhancing the configuration options for browser flags.
Copy link
Member

@cezaraugusto cezaraugusto left a comment

Choose a reason for hiding this comment

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

++ this is a fantastic contribution, thanks @Worthingtravis!

@cezaraugusto cezaraugusto merged commit 87b0160 into extension-js:main May 2, 2025
@Worthingtravis
Copy link
Contributor Author

++ this is a fantastic contribution, thanks @Worthingtravis!

Happy to help! Thanks for the approval ❤️

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.

[feature request] Allow customization of browserConfig
2 participants