Permalink
Browse files

gallery-2012.01.25-21-14 rgrove gallery-storage-lite

  • Loading branch information...
1 parent e7bae83 commit 295a227f3443a11abbcc515cebd46c9550b2af56 YUI Builder committed Jan 25, 2012
Showing with 13 additions and 9 deletions.
  1. +13 −9 src/gallery-storage-lite/js/storage-lite.js
@@ -37,15 +37,19 @@ storageMode;
// -- Implementation -----------------------------------------------------------
// Determine the best available storage mode.
-if (w.localStorage) {
- storageMode = MODE_HTML5;
-} else if (w.globalStorage) {
- storageMode = MODE_GECKO;
-} else if (w.openDatabase && navigator.userAgent.indexOf('Chrome') === -1) {
- storageMode = MODE_DB;
-} else if (Y.UA.ie >= 5) {
- storageMode = MODE_USERDATA;
-} else {
+try {
+ if (w.localStorage) {
+ storageMode = MODE_HTML5;
+ } else if (w.globalStorage) {
+ storageMode = MODE_GECKO;
+ } else if (w.openDatabase && navigator.userAgent.indexOf('Chrome') === -1) {
+ storageMode = MODE_DB;
+ } else if (Y.UA.ie >= 5) {
+ storageMode = MODE_USERDATA;
+ } else {
+ storageMode = MODE_NOOP;
+ }
+} catch (ex) {
storageMode = MODE_NOOP;
}

0 comments on commit 295a227

Please sign in to comment.