-
Notifications
You must be signed in to change notification settings - Fork 414
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 isSupported metric property #65
Comments
An In general, if you want to know if a metric is supported you can use the |
Thanks for answering Phil. In the best case, I wouldn't want to feature-detect outside of The feature detection code you linked is exactly what I had in mind to tweak it a little bit.
Feel free to close if you don't consider adding something along these lines. :) |
I left this open because I wanted to think about whether it made sense to expose this in some way. My initial inclination was to return the
I'm also hesitant to change the callback signature since lots of code out there is already written with the expectation that the callback is only invoked if the metric was successfully captured as is ready to be reported. All in all, I think I want to stick with the original principle that the library should run in all browsers, but the callback will only be invoked in the browser supports the metric. |
I'm currently trying to wrap the web vitals lib into a custom
<web-vitals />
element.It would be great if there would be a way to get information about the support of a particular metric. E.g. in Firefox the reporters are just not called. I could imagine to include an
isSupported
property or similar in themetric
object that is passed to the particular reporter. Could this be a valuable addition?Thanks a bunch for this project, it's great!
The text was updated successfully, but these errors were encountered: