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

Shows a message for LCP only tab is loaded in background #31

Conversation

housseindjirdeh
Copy link
Contributor

@housseindjirdeh housseindjirdeh commented Apr 30, 2020

Fixes #7.

Instead of relying on Page Visibility, this just checks for tabs that are updated but not active at the same time (and stores a boolean that popup.js checks for before displaying a message).

If you think the message should live within a toggle or <details>, I can update this!

Screen Shot 2020-04-30 at 6 15 10 PM

Gif

ezgif com-gif-maker (9)

@housseindjirdeh
Copy link
Contributor Author

housseindjirdeh commented Apr 30, 2020

If you're okay with this approach, let me know and I can also add the message to the HUD overlay 🕺

@addyosmani
Copy link
Member

addyosmani commented Apr 30, 2020

This is great @housseindjirdeh. Just tested it out with a number of different background tab scenarios (and switching back to loading normal tabs) and the experience appears to report backgrounding correctly. Appreciate your time on this.

Please feel free to add this to the overlay in a separate PR :)

Copy link
Member

@addyosmani addyosmani left a comment

Choose a reason for hiding this comment

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

LGTM

@addyosmani addyosmani merged commit baee467 into GoogleChrome:master Apr 30, 2020
@addyosmani addyosmani deleted the show-lcp-message-background-tab branch April 30, 2020 23:01
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

Successfully merging this pull request may close these issues.

Warn about LCP inflated by background loading
2 participants