Skip to content

Offline IE #2

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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