Closed Bug 1597253 Opened 5 years ago Closed 5 years ago

Implement Page.lifecycleEvent

Categories

(Remote Protocol :: CDP, task, P1)

task

Tracking

(firefox72 fixed)

RESOLVED FIXED
Firefox 72
Tracking Status
firefox72 --- fixed

People

(Reporter: whimboo, Assigned: whimboo)

References

(Blocks 4 open bugs, )

Details

(Whiteboard: [puppeteer-alpha])

Attachments

(2 files)

As David mentioned to me this event seems to block our testing capabilities for Gutenberg tests, and that I should have a look at it. I will have a look first how Chrome's behavior is, and then get it implemented for the remote agent.

Depends on: 1597259

This test indicates that those event's aren't only fired for Page related events but also for other domains like Network, which in this case is for networkIdle events.

Otherwise it needs to be fired for each top-level page lifecycle event like navigation, load, paint, etc... A list of important events where this event needs to be emited. Those events are:

    [0] : DOMContentLoaded
    [1] : firstContentfulPaint
    [2] : firstMeaningfulPaint
    [3] : firstMeaningfulPaintCandidate
    [4] : firstPaint
    [5] : init
    [6] : load
    [7] : networkAlmostIdle
    [8] : networkIdle

With the patch on this bug I will get this implemented for any event we currently support. For others a follow-up bug needs to be filed.

Depends on: 1597643

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

[1] : firstContentfulPaint
[2] : firstMeaningfulPaint
[3] : firstMeaningfulPaintCandidate
[4] : firstPaint

These events are all performance related. And none of them are blocking the Gutenberg test suite.

[7] : networkAlmostIdle
[8] : networkIdle

Both are related to the Network domain which we haven't implemented yet beside some individual methods and events. So they will have to be done at a later time.

[0] : DOMContentLoaded
[5] : init
[6] : load

Those are the additions which I will cover on this bug.

Blocks: 1597659
Blocks: 1597660

Looking at logs from a simple Puppeteer script, I also see a commit lifecycle event after {"method":"Target.createTarget","params":{"url":"about:blank"},"id":2} and Page.enable.

commit precedes DOMContentLoaded. Is it a Blinkism?

See:

Here's a log in case it's useful. You can test your patch with this example, as well.

Attachment #9109994 - Attachment mime type: application/octet-stream → text/plain

(In reply to Maja Frydrychowicz :maja_zf (UTC-4) (maja@mozilla.com) from comment #4)

Looking at logs from a simple Puppeteer script, I also see a commit lifecycle event after {"method":"Target.createTarget","params":{"url":"about:blank"},"id":2} and Page.enable.

commit precedes DOMContentLoaded. Is it a Blinkism?

As it looks like the commit lifecycle event is only emitted when Page.setLifecycleEventsEnabled is set to true. As it would be a commit for that change, and all the navigation lifecycle events will follow. As discussed with Maja we can follow-up on that, and she filed bug 1597762.

Blocks: 1597762
Pushed by hskupin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7da18cae2e37 [remote] Implement Page.lifecycleEvent. r=remote-protocol-reviewers,maja_zf
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 72
Component: CDP: Page → CDP
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: