Skip to content

Possibility of a synchronous Profiler.stop for unload scenarios? #65

@nicjansma

Description

@nicjansma

One scenario that websites may encounter is having a Profiler active while the page begins to unload. If the website is listening to pagehide or beforeunload or unload, they may want to stop any active Profilers and send the data, but the Promise from Profiler.send() may not fire/resolve in time before the site is unloaded.

Would it be possible to support a synchronous version of Profiler.stop() in some way for this scenario? Where a site could indicate it really needs the data before the function returns?

Yes, this could have an effect on the user experience by delaying the unload/new navigation, and we're trying to get away from long-blocking sync calls (e.g. sync XHRs). But there are scenarios like abandoned navigations (that don't reach onload and just go to unload), where a profile could give insight into possible causes.

FWIW there is similar to feedback for the Compression Streams API: whatwg/compression#38 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions