Skip to content

Commit

Permalink
Merge pull request #270 from jharding/245-safari-private-local-storage
Browse files Browse the repository at this point in the history
Improve detecting of localStorage
  • Loading branch information
jharding committed Jun 25, 2013
2 parents 9b360a3 + 12181b5 commit f900b4c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/persistent_storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ var PersistentStorage = (function() {

try {
ls = window.localStorage;

// while in private browsing mode, some browsers make
// localStorage available, but throw an error when used
ls.setItem('~~~', '!');
ls.removeItem('~~~');
} catch (err) {
ls = null;
}
Expand Down

0 comments on commit f900b4c

Please sign in to comment.