Check if browser support localStorage

fixes #1144