Especially if as JS feature detection can i use:
if (localStorage in window) { // you have local storage }
or even easier:
if (crypto.subtle) { // you can encrypt document}
And for css detection:
if (CSS.supports('display', 'flex')) { // you can load flex layout }
It's easy to forget some small things, and to be sure that you don't have problems on any browser, you'd have to test extensively. For instance, the second example (if (crypto.subtle)) would fail on some browsers where crypto is not defined (subtle is not a child of undefined).
So, no, it's not necessary. It's just very convenient.
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