question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] BrowserContext should be aware of pages opened by external sources

See original GitHub issue

BrowserContext.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:closed
  • Created 2 years ago
  • Comments:14 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
dakLSScommented, May 28, 2021

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.

1reaction
yury-scommented, May 28, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found