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

Add workaround for Safari FCP bug #145

Merged
merged 1 commit into from
May 4, 2021
Merged

Add workaround for Safari FCP bug #145

merged 1 commit into from
May 4, 2021

Conversation

philipwalton
Copy link
Member

This PR fixes #144 by first checking performance.getEntriesByName('first-contentful-paint') before registering the PerformanceObserver. If a valid entry is returned, then using PerformanceObserver is not needed. If no entry is returned it means either:

  • Paint Timing is not supported, or
  • The browser has not painted yet

In either case PerformanceObserver can be used as a fallback.

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.

Safari supports FCP but does not support the buffered flag
1 participant