fix(browserstack-service): route browserstack_executor commands via HTTP/S in BiDi sessions - #118
Open
smarkows wants to merge 1 commit into
Open
Conversation
…TTP/S in BiDi sessions In BiDi sessions, browser.execute() routes over WebSocket directly to the browser, bypassing BrowserStack's HTTP hub, so browserstack_executor: commands fail silently. Overwrite the execute command in BiDi sessions to route executor-prefixed scripts through executeScript (which always uses HTTP/S), leaving all other scripts untouched. Handles single-browser and multiremote setups. Ported from webdriverio/webdriverio#15216. Co-Authored-By: RohanImmanuel <RohanImmanuel@users.noreply.github.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Ports webdriverio/webdriverio#15216 (by @RohanImmanuel) into this repo.
In BiDi sessions,
browser.execute()routes over WebSocket directly to the browser, bypassing BrowserStack's HTTP hub, sobrowserstack_executor:commands fail silently. This overwrites theexecutecommand in BiDi sessions to route executor-prefixed scripts throughexecuteScript(which always uses HTTP/S), leaving all other scripts untouched. Handles both single-browser and multiremote setups, wrapped in try/catch so a patch failure can't break init.Credit: original implementation by @RohanImmanuel in webdriverio/webdriverio#15216.
🤖 Generated with Claude Code