-
Notifications
You must be signed in to change notification settings - Fork 9k
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
[Bug]: Frame navigated event did not trigger #9264
Comments
@tzbo Presumable the code you show is in your HTML. Are you setting up listeners before navigating to the page, like so:
This worked for me. Setting of Listeners should happen before navigation, else they may be added after the event has occurred. |
https://abrahamjuliot.github.io/creepjs/tests/iframes.html You can open this to test. |
Is it possible you are closing the window as soon as the page load.? It looks like your code is Async and would need a way to await the changes. Example with
That can also be |
Please try to open this link. The [same origin] frame will not trigger [frameattached] event. You can find 8 [frameattached] events if you open this link. But there should be 9 events. The code creates 8 iframes and there is another main frame. So there should be 9 events. |
@tzbo Can you provide your Puppeteer Script that the issue is happening? |
const browser = await puppeteer.launch();
const page = await browser.newPage();
page.on("frameattached", () => {
console.log(`It attached.`);
});
page.on("framedetached", () => {
console.log(`It detached.`);
});
await page.goto("https://abrahamjuliot.github.io/creepjs/tests/iframes.html");
await page.waitForNetworkIdle();
await browser.close(); This script is okay. There should be nine [It attached] events. But got 8. |
@tzbo @Lightning00Blade IMO, sounds like it is working as expected. The main frame is never attached/detached as it exists since the creation of the page and can only be navigated (which the goto handles). |
May be same problem with 1106 |
Bug description
Steps to reproduce the problem:
This code will not trigger [frameattached] and [framenavigated].
If add break point at [const iframe = document.createElement('iframe')], then the event can be triggered again.
Puppeteer version
19.2.2
Node.js version
18
npm version
8.4
What operating system are you seeing the problem on?
macOS
Configuration file
No response
Relevant log output
No response
The text was updated successfully, but these errors were encountered: