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

Handle exception "No frame for given id found" while opening page which contains slow loading iframe #130

Open
oonid opened this issue Nov 11, 2020 · 0 comments

Comments

@oonid
Copy link

oonid commented Nov 11, 2020

Hi,
thank you for the puppeteer-dart library.

I got the exception "No frame for given id found", which I believe from the chromium's inspector_page_agent.cc.

I try to handle .click() of ElementHandle which open new page (tab). Inside the new page, it has iframe. I got an exception only if the iframe was too slow to load even though the page was actually opened.

this is my code to get the target:

await eh.click(delay: Duration(seconds: delay_in_secs));
try {
    newTarget = await prevPage.browser.waitForTarget(
        (target) => target.opener == prevTarget && target.type == "page",
        timeout: Duration(seconds: timeout_in_secs));
    newPage = await newTarget.page; // got exception
} catch (e) {
    print('got exception: ${e}');
}

I have tried to get the page from browser.pages but it's triggered the same exception.
I have tried to get the target from browser.targets it's successful to get the target list, but when I try to get the page from the target via await target.page it's also triggered the same exception.

I'm sorry, I don't know how to reproduce the situation (the slow loading iframe), so I can not submit the related code here.
I can not use the page, also can not close it via other methods.

From the above chromium exception, I think it's related to the puppeteer-dart protocol of page: setDocumentContent and createIsolatedWorld, but still don't know how to add extra information related to it.

does anyone have an idea how to get the page or just close the page?

thank you.

ps: I also post this question on StackOverflow a few days ago.

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

No branches or pull requests

1 participant