Skip to content

Offline IE #2

@Aurelain

Description

@Aurelain

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions