localStorage icon indicating copy to clipboard operation
localStorage copied to clipboard

Offline IE

Open Aurelain opened this issue 9 years ago • 0 comments

On IE, localStorage does not work with the "file:///" protocol. If you want to polyfill it, you must avoid direct assignment of window.localStorage. Instead, you must use "Object.defineProperty()", like this:

window.localStorage = 'hello';
alert(window.localStorage); // undefined
Object.defineProperty(window, 'localStorage', {value:'hello'});
alert(window.localStorage); // hello

As a side note, I think only the Flash technique works in IE Offline

Aurelain avatar Sep 16 '15 12:09 Aurelain