diff --git a/AppPackages/README.md b/AppPackages/README.md index f2830bfb..c0587c54 100644 --- a/AppPackages/README.md +++ b/AppPackages/README.md @@ -50,4 +50,4 @@ display buttons that let you pick the file or the file's folder. Alternatively, you can download files from http://wiki.kiwix.org/wiki/Content_in_all_languages on a regular PC. The single non-indexed ZIM files work best. However, if you plan to store your ZIM file on an SD card formatted as FAT32, you will only be able to use the split files (.zimaa, .zimab, etc.) in the pre-indexed -archives. If your SD card is formatted as exFAT or NTFS, you can use either, but single file is easiest. +archives. If your SD card is formatted as exFAT or NTFS, you can use either, but single file is easiest. diff --git a/www/js/app.js b/www/js/app.js index c1c4f832..4cd750cf 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -2561,13 +2561,25 @@ define(['jquery', 'zimArchiveLoader', 'uiUtil', 'util', 'utf8', 'images', 'cooki if (params.rememberLastPage) { cookies.setItem('lastPageVisit', params.lastPageVisit, Infinity); //Store current document's raw HTML in localStorage for fast restart - if (typeof Storage !== "undefined") { + if ('localStorage' in window && window['localStorage'] !== null) { try { // Ensure we don't go over quota localStorage.removeItem('lastPageHTML'); localStorage.setItem('lastPageHTML', htmlArticle); } catch (err) { - console.log("localStorage not supported: " + err); + if (/quota\s*exceeded/i.test(err.message)) { + // Note that Edge gives a quotaExceeded message when running from localhost even if the quota isn't exceeded + // Basically, it means localStorage is not supported in Edge running from localhost... + if (params.cookieSupport == 'local_storage') { + uiUtil.systemAlert('Your localStorage has exceeded its quota, so we are forced to clear it.\n' + + 'Because your browser is using localStorage for remembering your settings, these may\n' + + 'have been reset. Next time the app launches, please go to Config and set them again.'); + } + console.log('Clearing localStorage because quota was exceeded...'); + localStorage.clear(); + } else { + console.error("Something went wrong with localStorage: ", err); + } } } params.lastPageHTML = htmlArticle;