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

Work on existing pages #106

Open
lucafabbian opened this issue Nov 5, 2024 · 3 comments
Open

Work on existing pages #106

lucafabbian opened this issue Nov 5, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@lucafabbian
Copy link

I would like to work on already opened pages rather than using await browser.newPage every time. Especially useful when testing astral from deno jupyter notebooks, since those are sometimes subjected to crashes.

@lino-levan lino-levan added the enhancement New feature or request label Nov 12, 2024
@chaosharmonic
Copy link
Contributor

This sounds like it might be similar to what's happening in #86

It seems to be that the default behavior is to open a new window when starting a session

@lucafabbian
Copy link
Author

@lino-levan , I came up with a solution for that. I would like to implement two new methods on the "browser" class.

browser.listAllPages() that returns the content of http://localhost:9222/json

browser.importExistingPage(page obj or websocket url) that checks if the page already exists amongst browser.pages[] or otherwise starts a new websocket link

If you like the idea, I can come up with a PR

@lino-levan
Copy link
Owner

I'd be curious to look at precedent. How do puppeteer/playwright deal with this? Not against it though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants