Skip to content
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

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

Open
nicjansma opened this issue Dec 30, 2021 · 0 comments
Open

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

nicjansma opened this issue Dec 30, 2021 · 0 comments

Comments

@nicjansma
Copy link

nicjansma commented Dec 30, 2021

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant