Skip to content
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

Add local page handling to LocalPlaywrightComputer #11

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kirill-markin
Copy link

Problem

The current LocalPlaywrightComputer implementation does not properly handle new browser tabs events.

Solution

Added page handling functionality to LocalPlaywrightComputer similar to BrowserbaseBrowser:

  • Added browser context creation instead of direct page creation
  • Added event listeners for new tabs and page closing
  • Implemented proper page switching when active page is closed

When a new tab is created, the terminal now shows "New page created" message and properly switches to it.

- Add event listeners for page creation in local browser
- Implement page handling similar to BrowserbaseBrowser
- Fix issue with new tabs not being detected
@gianpaj
Copy link

gianpaj commented Mar 13, 2025

This helped me. Otherwise, it would just open new tabs in MS Copilot's for some reason.

$ python cli.py --computer local-playwright --debug
New page created
> go to amazon.com

Though, for some reason,n it searched for gaming keyboard on Amazon after :D

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