Skip to content

Commit

Permalink
chrome incognito doesnt throw on websqldb anymore. hooray.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirish committed Oct 21, 2011
1 parent a93625c commit 37caffb
Showing 1 changed file with 3 additions and 20 deletions.
23 changes: 3 additions & 20 deletions modernizr.js
Expand Up @@ -414,28 +414,11 @@ window.Modernizr = (function( window, document, undefined ) {
return !!window.postMessage;
};

// Web SQL database detection is tricky:

// In chrome incognito mode, openDatabase is truthy, but using it will
// throw an exception: http://crbug.com/42380
// We can create a dummy database, but there is no way to delete it afterwards.

// Meanwhile, Safari users can get prompted on any database creation.
// If they do, any page with Modernizr will give them a prompt:
// http://github.com/Modernizr/Modernizr/issues/closed#issue/113

// We have chosen to allow the Chrome incognito false positive, so that Modernizr
// doesn't litter the web with these test databases. As a developer, you'll have
// to account for this gotcha yourself.
// Chrome incognito mode used to throw an exception when using openDatabase
// It doesn't anymore.
tests['websqldatabase'] = function() {
var result = !!window.openDatabase;
/* if (result){
try {
result = !!openDatabase( mod + "testdb", "1.0", mod + "testdb", 2e4);
} catch(e) {
}
} */
return result;
return !!window.openDatabase;
};

// Vendors had inconsistent prefixing with the experimental Indexed DB:
Expand Down

0 comments on commit 37caffb

Please sign in to comment.