mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-17 15:11:04 +00:00
26 lines
677 B
JavaScript
26 lines
677 B
JavaScript
/*!
|
|
{
|
|
"name": "Session Storage",
|
|
"property": "sessionstorage",
|
|
"tags": ["storage"],
|
|
"polyfills": ["joshuabell-polyfill", "cupcake", "sessionstorage"]
|
|
}
|
|
!*/
|
|
define(['Modernizr'], function(Modernizr) {
|
|
// Because we are forced to try/catch this, we'll go aggressive.
|
|
|
|
// Just FWIW: IE8 Compat mode supports these features completely:
|
|
// www.quirksmode.org/dom/html5.html
|
|
// But IE8 doesn't support either with local files
|
|
Modernizr.addTest('sessionstorage', function() {
|
|
var mod = 'modernizr';
|
|
try {
|
|
sessionStorage.setItem(mod, mod);
|
|
sessionStorage.removeItem(mod);
|
|
return true;
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
});
|
|
});
|