Commit 2767ce82 authored by Marco Kellershoff's avatar Marco Kellershoff 🤸

Only refresh bgColor cache if it's different

Previous, every load of newtab.gorilla.moe changed the localStorage key
`bgColor`, even if it was the same value than already cached.
parent 1d687721
......@@ -4,7 +4,7 @@
"name": "Super Evil New Tab",
"short_name": "SENT",
"author":"Marco Kellershoff",
"version": "7.0.0",
"version": "7.0.1",
"description": "Fixes the super evil new tab page.",
"options_page": "options.html",
"permissions": [
......
......@@ -14,10 +14,13 @@
let js = document.createElement("script");
getOption("bgColor", result => {
if (result.bgColor)
window.localStorage.setItem(
"bgColor",
result.bgColor
);
const cachedBgColor = window.localStorage.getItem("bgColor");
if (result.bgColor !== cachedBgColor) {
window.localStorage.setItem(
"bgColor",
result.bgColor
);
}
});
getOption("css", result => {
css.innerHTML = result.css;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment