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

core: move no-unload-listeners to perf category #13497

Merged
merged 3 commits into from
Dec 14, 2021
Merged

Conversation

brendankenny
Copy link
Member

The Chrome bfcache team has determined that unload handlers are the top developer-controllable reason pages aren't able to use the bfcache. The bfcache is by far the fastest way to load a page if navigating by history, so it makes sense to have the audit in the perf category. We discussed this back in #11085 (comment) but punted on the question at the time.

Having it in the perf category also means it will show up in the PSI report, which will reach that many more developers.

Also updates the learn more link to the newer https://web.dev/bfcache article.

@brendankenny brendankenny requested a review from a team as a code owner December 14, 2021 20:06
@brendankenny brendankenny requested review from connorjclark and removed request for a team December 14, 2021 20:06
@@ -15,7 +15,7 @@ const UIStrings = {
/** Descriptive title of a Lighthouse audit that checks if a web page has 'unload' event listeners and finds that it is using them. */
failureTitle: 'Registers an `unload` listener',
/** Description of a Lighthouse audit that tells the user why pages should not use the 'unload' event. This is displayed after a user expands the section to see more. 'Learn More' becomes link text to additional documentation. */
description: 'The `unload` event does not fire reliably and listening for it can prevent browser optimizations like the Back-Forward Cache. Consider using the `pagehide` or `visibilitychange` events instead. [Learn more](https://developers.google.com/web/updates/2018/07/page-lifecycle-api#the-unload-event)',
description: 'The `unload` event does not fire reliably and listening for it can prevent browser optimizations like the Back-Forward Cache. Use `pagehide` or `visibilitychange` events instead. [Learn more](https://web.dev/bfcache/#never-use-the-unload-event)',
Copy link
Member Author

@brendankenny brendankenny Dec 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stronger-worded advice because from experiments the bfcache team did, disabling/ignoring unload handlers in some circumstances (like Safari sometimes does) probably won't be an option for Chrome due to web breakage.

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

Successfully merging this pull request may close these issues.

3 participants