userscript...

This commit is contained in:
Gabe Yuan
2023-08-05 15:32:51 +08:00
parent bec207a09f
commit 1e82c280ad
11 changed files with 323 additions and 202 deletions

View File

@@ -21,11 +21,11 @@ async function set(key, val) {
async function get(key) {
if (isExt) {
const res = await browser.storage.local.get([key]);
return res[key];
const val = await browser.storage.local.get([key]);
return val[key];
} else if (isGm) {
const res = await window.GM.getValue(key);
return res;
const val = await window.GM.getValue(key);
return val;
}
return window.localStorage.getItem(key);
}