-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
.matches is not a function causes many audits to error #5934
Comments
Thanks for filing the very detailed explanation @lethevimlet! We would love your input here because what we're trying to communicate with If you hover over the "Error!" you should see a tooltip that reads
Either way we should try to find a way to fix. Thanks for the minified repro to help us too! |
@patrickhulce Nice to hear this comes handy, regarding the Error! communication intention, how about the use of Warning! instead, IMO error feels like something went wrong that might be my fault, whereas Warning! explicitly draws my attention as a developer, saying there's something here you want to read, therefore more people would see the hover tooltip that I totally missed. Other more verbose possibilities includes "Not Applicable", "Irresolvable" or "Ups! Something Went Wrong 😅" if the last one is preferred, please note the emoji is a must! |
Hi, I was using object HTML tag to exploit element resize detection. Unfortunately, I found through lighthouse that this is detected as using "plugins" a.k.a embedded flash/silverlight/etc even when actually not embedding anything. I strongly suggest lighthouse/google to check for the data attribute of object tag before flagging it as "plugin" usage since object tag is one of the most efficient/cross-browser compatible ways of detecting element resize events, therefore only count as a use of "plugins" if it actually has a data attribute defined.
Anyway, after removing all object tags to my surprise I found I was still getting nagged about the use of "plugins". Digging through the code, and actually checking the source of Lighthouse plugin test, I managed to find the problem, apparently if you define for an element a matches property, this will trigger a false positive for "use of plugins", and maybe other tests too.
For example
will cause "use of plugins" audit to fail, it will even fail when initialized to null.
My wild guess is that you are using matches internally to flag elements and doing something along the lines of
If this is the case and you are injecting properties to parse the DOM, you should be using a safe scope such as
I hope this helps to nail down the issue and hope this behavior does not reflect to the actual SEO algorithm.
BTW good job with Lighthouse tool, it's getting more and more awesome each day!
Here is the smallest example I can think of, to prove the concept.
The text was updated successfully, but these errors were encountered: