I found a weird problem: whatever parameters passed to the hasFeature function, it always returns true.
console.log(document.implementation.hasFeature('HTML', '2.0'));//return true
console.log(document.implementation.hasFeature('fake', '9.0'));//return true
Can anyone pls tell me why the hasFeature() function does not work properly?
From MDN: DOMImplementation.hasFeature()
The
DOMImplementation.hasFeature()
method returns a Boolean flag indicating if a given feature is supported. It is deprecated and modern browsers return true in all cases.The different implementations fairly diverged in what kind of features were reported. The latest version of the spec settled to force this method to always return true, where the functionality was accurate and in use.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With