Open Bug 1930594 Opened 1 year ago Updated 15 days ago

Don't emit "domContentLoaded" and "load" events when creating new top-level browsing contexts (tabs) when "about:blank" is loaded and emit contextCreated event at the end

Categories

(Remote Protocol :: WebDriver BiDi, task, P2)

task
Points:
5

Tracking

(Not tracked)

ASSIGNED

People

(Reporter: Sasha, Assigned: Sasha)

References

(Blocks 3 open bugs)

Details

(Whiteboard: [webdriver:m20])

After reading the html spec on the topic of creating a top-level browsing context with about:blank, I've noticed that in the browsing context creation algorithm we’re supposed to create and load a document, but it looks like it skips all the post parsing steps, where we’re supposed to send browsingContext.domContentLoaded and browsingContext.load events, and just jumps to the end of it (to the step 11). So it looks like per spec we shouldn’t send the load events. At the same time, it seems like we should send the browsingContext.contextCreated event almost at the end (see step 12) before we return.
According to Alex, if we don't send load events but send the contextCreated event when a tab is fully loaded, that should be enough for Puppeteer. But at the moment of this bug creation, Chrome sends the load events for such case and send browsingContext.contextCreated events very early (before load events).

Blocks: 1756597, 1756617

Moving it already to M14 as discussed yesterday in the meeting.

Whiteboard: [webdriver:m14]
Points: --- → 5
Priority: -- → P3

Test updates will be synced soon via bug 1932829.

Depends on: 1932829
Whiteboard: [webdriver:m14] → [webdriver:m15]
Priority: P3 → P2
Whiteboard: [webdriver:m15] → [webdriver:m16]
Whiteboard: [webdriver:m16] → [webdriver:m17]
Whiteboard: [webdriver:m17] → [webdriver:backlog]

Looks like since I've created this bug, Chrome updated their implementation, and they do not emit load events for "about:blank" anymore. But since there are no really requests to fix it now, I think it still makes sense to wait for bug 543435 to land before working on this bug.

Depends on: sync-about-blank
Duplicate of this bug: 1988202

Note that we currently send the load events for browsing contexts created with browsingContext.create and window.open("about:blank") but not for those created with window.open().

Holger, mind testing again now that the about:blank load is happening synchronously?

Flags: needinfo?(hbenl)

(In reply to Henrik Skupin [:whimboo][⌚️UTC+2] from comment #6)

Holger, mind testing again now that the about:blank load is happening synchronously?

Firefox now always sends the load events for new browsing contexts (including those opened with window.open() which didn't get load events previously).

Flags: needinfo?(hbenl)
Blocks: 1750547
Summary: Don't emit load events when creating new top-level browsing contexts (tabs) when "about:blank" is loaded and emit contextCreated event at the end → Don't emit "domContentLoaded" and "load" events when creating new top-level browsing contexts (tabs) when "about:blank" is loaded and emit contextCreated event at the end
See Also: → 2015265
Blocks: 2015265
See Also: 2015265
Whiteboard: [webdriver:backlog] → [webdriver:m20]
Assignee: nobody → aborovova
Status: NEW → ASSIGNED
You need to log in before you can comment on or make changes to this bug.