feat(browse): support Chrome extensions via BROWSE_EXTENSIONS_DIR#315
Open
yinanli1917-cloud wants to merge 1 commit intogarrytan:mainfrom
Open
feat(browse): support Chrome extensions via BROWSE_EXTENSIONS_DIR#315yinanli1917-cloud wants to merge 1 commit intogarrytan:mainfrom
yinanli1917-cloud wants to merge 1 commit intogarrytan:mainfrom
Conversation
When the BROWSE_EXTENSIONS_DIR environment variable is set to a path containing an unpacked Chrome extension, browse launches Chromium in headed mode with the window off-screen (simulating headless) and loads the extension. This enables use cases like ad blockers (reducing token waste from ad-heavy pages), accessibility tools, and custom request header management — all while maintaining the same CLI interface. Implementation: - Read BROWSE_EXTENSIONS_DIR env var in launch() - When set: switch to headed mode with --window-position=-9999,-9999 (extensions require headed Chromium) - Pass --load-extension and --disable-extensions-except to Chromium - When unset: behavior is identical to before (headless, no extensions) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3d04eec to
c90cfe7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
BROWSE_EXTENSIONS_DIRenvironment variable to load unpacked Chrome extensions into browse's Chromium instance--window-position=-9999,-9999) since Chrome extensions require a headed browserWhy
Browse users often have Chrome extensions that improve their browsing workflow — ad blockers (fewer tokens wasted on ad-heavy pages), accessibility tools, custom header managers, etc. Currently there's no way to bring these into browse's Chromium.
This is a single env var, zero config files, fully opt-in. One line in
.zshrcand it just works.Change
One file, 22 lines added:
browse/src/browser-manager.tsTest plan
BROWSE_EXTENSIONS_DIRunset → headless as before, no regressionBROWSE_EXTENSIONS_DIRset to valid unpacked extension → extension loads, pages render correctlyBROWSE_EXTENSIONS_DIRset to invalid path → Chromium launches normally (extensions silently ignored)🤖 Generated with Claude Code