Skip to content

Commit

Permalink
detect localStorage
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Lehnardt authored and paulirish committed Nov 4, 2009
1 parent b64795b commit 5059daa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modernizr.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ window.Modernizr = (function(){
background = 'background',
backgroundColor = background + 'Color',
canPlayType = 'canPlayType',
localStorage = 'localStorage',

tests = {},
inputs = {},
Expand Down Expand Up @@ -409,6 +410,10 @@ window.Modernizr = (function(){
return !!doc.createElement(audio)[canPlayType];
};

tests[localStorage] = function() {
return (typeof window.localStorage != 'undefined');
}


// Run through all tests and detect their support in the current UA.
for ( feature in tests ) {
Expand Down

0 comments on commit 5059daa

Please sign in to comment.