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
frame.title() throws protocol error when used with framenavigated #827
Comments
+1 |
Might be related, #1325. |
Look at Puppeteer and browser communication:
|
aslushnikov
added a commit
to aslushnikov/puppeteer
that referenced
this issue
Nov 18, 2017
In Blink, frames don't necesserily have execution context all the time. DevTools Protocol precisely reports this situation, which results in Puppeteer's frame.executionContext() being null occasionally. However, from puppeteer point of view every frame will have at least a default executions context, sooner or later: - frame's execution context might be created naturally to run frame's javascript - if frame has no javascript, devtools protocol will issue execution context creation This patch builds up on this assumption and introduces a PendingContext: - Initially, frame is created with a PendingContext instead of a real context - When frame clients request evaluations, PendingContext records evaluation requests - When a real execution context is created, the PendingContext runs all the postponed evaluations in the real context Fixes puppeteer#827, puppeteer#1325
aslushnikov
added a commit
that referenced
this issue
Nov 19, 2017
…#1415) In Blink, frames don't necesserily have execution context all the time. DevTools Protocol precisely reports this situation, which results in Puppeteer's frame.executionContext() being null occasionally. However, from puppeteer point of view every frame will have at least a default executions context, sooner or later: - frame's execution context might be created naturally to run frame's javascript - if frame has no javascript, devtools protocol will issue execution context creation This patch builds up on this assumption and makes frame.executionContext() to be a promise. As a result, all the evaluations await for the execution context to be created first. Fixes #827, #1325 BREAKING CHANGE: this patch changes frame.executionContext() method to return a promise. To migrate onto a new behavior, await the context first before using it.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Repro:
Produces:
The text was updated successfully, but these errors were encountered: