Change: use localStorage instead of sessionStorage

This commit is contained in:
eight 2019-08-28 14:11:49 +08:00
parent 5504138857
commit 911108c3b4

View File

@ -57,11 +57,11 @@ const APPLY = (() => {
updateCount();
updateExposeIframes();
try {
// FIXME: use try-catch since accessing sessionStorage may throw?
// FIXME: use try-catch since accessing localStorage may throw?
if (styleInjector.list.length) {
sessionStorage.setItem('stylusStyleCount', styleInjector.list.length);
localStorage.setItem('stylusStyleCount', styleInjector.list.length);
} else {
sessionStorage.removeItem('stylusStyleCount');
localStorage.removeItem('stylusStyleCount');
}
} catch (err) {
// pass
@ -101,8 +101,8 @@ const APPLY = (() => {
let ready;
let styleCount;
try {
// FIXME: use try-catch since accessing sessionStorage may throw?
styleCount = sessionStorage.getItem('stylusStyleCount');
// FIXME: use try-catch since accessing localStorage may throw?
styleCount = localStorage.getItem('stylusStyleCount');
} catch (err) {
// pass
}