Repository navigation
Cdp readystate about blank - #3862
Conversation
| // special case: protocols like CDP or webdriver use a fastpath for the default about:blank page. | ||
| // the page is considered immediately loaded **but** the _ready_state stay waiting for internal navigation reasons. | ||
| // So if the page is about:blank, shortcut ready_state to return complete. | ||
| if (URL.isAboutBlank(self.getURL(frame))) { |
There was a problem hiding this comment.
This seems over-broad. A new iframe that does a document.open will get "complete" instead of the "loading" that it should.
In Session.createPage set frame.document._ready_state = .complete.; which then covers the "the default about:blank".
And atop Frame.navigate, you can always reset it to .loading
| // Like Chrome, report the initial about:blank as loaded. Its state is left | ||
| // as is, since the first navigation reuses it (see canNavigateInPlace). | ||
| if (frame._load_state == .waiting) { | ||
| if (URL.isAboutBlank(frame.url)) { |
There was a problem hiding this comment.
This covers the new case, but it breaks an explicit about:blank navigate. I tested in chrome by changing puppeteer/basic.js to navigate "about:blank", and I still got the network idle events.
I think you want a combination of the two, frame._load_state == .waiting and URL.isAboutBlank(frame.url) ?
|
Thanks for the review, I mixed up |
|
I can remove the |
|
I think most of our about:blank checks should match against about:blank#x and about:blank?x so having the function is a first step towards that. |
Follow-up for #3598
loadevent on lifecycle event enabledDocument.readyStatew/ about:blanklightpanda-io/demo#272 updates the e2e test