Skip to content

update browser context based on provider, update hyperbrowser SDK ver… - #66

Merged
NikhilShahi merged 2 commits into
mainfrom
update-browser-context
Nov 25, 2025
Merged

NikhilShahi merged 2 commits into
mainfrom
update-browser-context

Conversation

@NikhilShahi

@NikhilShahi NikhilShahi commented Nov 24, 2025

Copy link
Copy Markdown
Contributor

…sion


Note

Reuses existing browser context for Hyperbrowser providers during init and upgrades @hyperbrowser/sdk to 0.78.0 with a package version bump to 1.0.5.

  • Agent:
    • Context initialization: In src/agent/index.ts, initBrowser() now reuses an existing browser context when browserProviderType is "Hyperbrowser"; otherwise creates a new context with viewport: null.
  • Dependencies:
    • Upgrade @hyperbrowser/sdk to 0.78.0.
    • Bump package version to 1.0.5.

Written by Cursor Bugbot for commit 09c48b8. This will update automatically on new commits. Configure here.

Comment thread src/agent/index.ts
Comment thread src/agent/index.ts
this.context = await this.browser.newContext({
viewport: null,
});
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: Init script not applied to existing Hyperbrowser pages

When reusing an existing Hyperbrowser context, addInitScript is called after the context may already have pages open. Since addInitScript only affects pages created after it's called, existing pages won't have the event listener tracking script that sets data-has-interactive-listener attributes. This causes the agent to fail identifying interactive elements on pre-existing pages in Hyperbrowser sessions, while working correctly for Local provider where contexts are always newly created.

Fix in Cursor Fix in Web

@NikhilShahi
NikhilShahi merged commit 18f225d into main Nov 25, 2025
3 checks passed
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