Follows-up
430a0d3984, which created a private property that stored a
reference to the localStorage object outside the get and set methods.
Where previously it was used directly, and as such, covered by
the try/catch around getItem and setItem calls.
Bug: T148998
Change-Id: Ibe75408913d4ffbf1791e1a6470296b29f809185
*/
mw.storage = {
- localStorage: window.localStorage,
+ localStorage: ( function () {
+ // Catch exceptions to avoid fatal in Chrome's "Block data storage" mode
+ // which throws when accessing the localStorage property itself, as opposed
+ // to the standard behaviour of throwing on getItem/setItem. (T148998)
+ try {
+ return window.localStorage;
+ } catch ( e ) {}
+ }() ),
/**
* Retrieve value from device storage.