BBC-Location-Services/locservices-core-js — pull request #29 by darrenlucas (2014-09-15 20:44:23+00:00)
Title: #27 - Changed method used to detect if localStorage is available

Unfortunately I didn't test across all browsers, issues with the previous implementation:
* ```typeof localStorage.getItem``` returns "object" in IE8
* localStorage is null in Firefox and IE when localStorage is disabled

Seems like the safest way is to actually set an item as per modernizr https://github.com/Modernizr/Modernizr/blob/master/feature-detects/storage/localstorage.js, as iOS in private browsing mode will throw an exception when setItem is called.

This time tested in:
* Chrome
* Firefox
* Safari