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 }