Feature detection++.  But, at this point every major browser has supported localstorage for [quite a few releases now](http://caniuse.com/#feat=namevalue-storage).