[BUG] BrowserContext should be aware of pages opened by external sources
See original GitHub issueBrowserContext.pages() does not know if a page is opened by a source other than Playwright. If an app other than Playwright opens a page, it doesn’t get added to context.pages(). This includes the recommended pattern from the docs:
If the action that triggers the new page is unknown, the following pattern can be used:
// Get all new pages (including popups) in the context
context.onPage(page -> {
page.waitForLoadState();
System.out.println(page.title());
});
The event is not emitted if a page is opened by an external source. It is emitted with context.newPage()
, however
Issue Analytics
- State:
- Created 2 years ago
- Comments:14 (5 by maintainers)
Top Results From Across the Web
[BUG] Extra Pages in LaunchPeristentContext #2083 - GitHub
Hello Team, there is a bug, we have a code as below : string osp ... .dev/docs/api/class-browsercontext#browser-context-pages, so you can ...
Read more >1081350 - Security: Browser_crash - Monorail
Open again the testcase on an incognito tab and click on the button then close 3. Wait => Crash! ==2176==ERROR: AddressSanitizer: ...
Read more >Safari Technology Preview Release Notes - Apple Developer
If you already have Safari Technology Preview installed, you can update in the Software Update pane of System Preferences on macOS Monterey, or...
Read more >JavaScript Contexts in NW.js
Some objects of Node context are copied to Browser context so that scripts running in Browser context can access Node.js objects:.
Read more >Changelog | Cypress Documentation
Added support for visiting cross-origin pages outside of a cy.origin() callback ... will see the source map line and column number in the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks again for all the help. Playwright has been a real game changer for me. Makes UI test automation far easier, faster, more reliable, and more maintainable.
Closing this issue as you seem to have a solution for the problem. Meanwhile, we’ll keep collecting feedback on how the events are dispatched to listeners to see what API would work better.
Feel free to reopen if you need more assistance.