PagesAsync does not return current list of pages after opened a new tab
See original GitHub issuePagesAsync always return only two tabs from following code, if a user clicked a link and opens a new tab, the new tab does not appear from PagesAsync. issue occur when there is an infinite loop
in actual project, I am experiencing this issue after I executed some JS code to click a link and wait for a new page to appear in a loop by polling with PagesAsync
is this a bug or am I doing something wrong?
Code to reproduce:
var browser = await Puppeteer.LaunchAsync(new LaunchOptions
{
Headless = false,
DefaultViewport = null
});
var page = await browser.NewPageAsync();
await page.GoToAsync("https://github.com/");
for (; ; )
{
var res = await browser.PagesAsync();
int xxxx = 0;//make a breakpoint here and see res from debugger
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Puppeteer detect when the new tab is opened and get ...
This code will catch the new page in a new tab if it was opened by clicking a link in the original page....
Read more >Emit new Page objects when new tabs created · Issue #386
I see it's returning a target object, but I actually can't figure out from the API or logging it what that actually is....
Read more >Use PuppeteerSharp.Browser.PagesAsync in Puppeteer- ...
Use the PagesAsync method in PuppeteerSharp package in your next Puppeteer-sharp project with LambdaTest Automation Testing Advisor.
Read more >How to get new tab/link opened on the right of the current ...
It is possible to select the tab opening position, the new tab behavior and the behavior after closing a tab in the Chrome...
Read more >When I open a new tab, the address area populates with ...
When ever I open a new tab in Firefox, this address populates the address ... The page does NOT LOAD, it just populates...
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 FreeTop 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
Top GitHub Comments
a strange workaround would be add another await operation before PagesAsync
works just fine:
Closed due to inactivity. Feel free to reopen it if needed.