Skip to content

Add local page handling to LocalPlaywrightComputer - #11

Merged
katia-openai merged 1 commit into
openai:mainfrom
kirill-markin:feature/improve-local-page-handling
Mar 17, 2025
Merged

Add local page handling to LocalPlaywrightComputer#11
katia-openai merged 1 commit into
openai:mainfrom
kirill-markin:feature/improve-local-page-handling

Conversation

@kirill-markin

Copy link
Copy Markdown
Contributor

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

gianpaj commented Mar 13, 2025

Copy link
Copy Markdown
Contributor

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

@katia-openai

Copy link
Copy Markdown
Collaborator

Thank you! Merging this now.

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.

3 participants