fix(runtime): honor OPENCLI_CDP_ENDPOINT for non-Electron browser commands#1598
Open
KhanCold wants to merge 1 commit into
Open
fix(runtime): honor OPENCLI_CDP_ENDPOINT for non-Electron browser commands#1598KhanCold wants to merge 1 commit into
KhanCold wants to merge 1 commit into
Conversation
…mands Previously, OPENCLI_CDP_ENDPOINT was only respected for Electron apps. Non-Electron browser commands (e.g., YouTube, HackerNews) always used BrowserBridge, which requires the Chrome extension and fails in headless environments. Changes: - getBrowserFactory() now accepts an optional cdpEndpoint parameter and returns CDPBridge when a CDP endpoint is provided (via argument or OPENCLI_CDP_ENDPOINT env var), regardless of site type. - execution.ts now passes the CDP endpoint to getBrowserFactory() for non-Electron browser commands when OPENCLI_CDP_ENDPOINT is set. Fixes jackwener#867
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.
Description
Honor
OPENCLI_CDP_ENDPOINTfor non-Electron browser commands that were still forcing Browser Bridge.Previously,
OPENCLI_CDP_ENDPOINTwas only respected for Electron apps (e.g., Cursor, Codex). Non-Electron browser commands (e.g.,opencli youtube,opencli hackernews) always usedBrowserBridge, which requires the Chrome extension and fails in headless environments without a GUI.This PR fixes the routing logic so that when
OPENCLI_CDP_ENDPOINTis set, all browser-backed commands route throughCDPBridge, enabling headless/remote server usage.Related issue: #867
Type of Change
Checklist
Changes
src/runtime.tsgetBrowserFactory()now accepts an optionalcdpEndpointparameterCDPBridgewhencdpEndpointis provided orOPENCLI_CDP_ENDPOINTenv var is setsrc/execution.tsOPENCLI_CDP_ENDPOINTand pass it togetBrowserFactory()src/runtime.test.ts(new)getBrowserFactory()withcdpEndpointargumentgetBrowserFactory()withOPENCLI_CDP_ENDPOINTenv varTest Results
Screenshots / Output
Before (with
OPENCLI_CDP_ENDPOINTset):After (with
OPENCLI_CDP_ENDPOINTset):Backward Compatibility
OPENCLI_CDP_ENDPOINT, behavior is identical to before