From 2ace6aaddc8d07a4696a8da6f8687a22f9738e04 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 1 Jul 2024 11:22:59 +0300 Subject: [PATCH] Fix adguard storage (#162) --- src/extensionPreferences/userScriptStore.ts | 4 +++- webpack.config.js | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/extensionPreferences/userScriptStore.ts b/src/extensionPreferences/userScriptStore.ts index 474b795..65ef8af 100644 --- a/src/extensionPreferences/userScriptStore.ts +++ b/src/extensionPreferences/userScriptStore.ts @@ -8,7 +8,9 @@ export default class UserScriptStore { return GM.setValue(key, value); } async get(key: string) { - return (await GM.getValue(key))[key]; + let val = await GM.getValue(key); + if (val === undefined) return val; + return val[key]; } name = "gmStore"; } diff --git a/webpack.config.js b/webpack.config.js index 54b6877..c0c2073 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -78,6 +78,8 @@ const userScriptBanner = `// ==UserScript== // @icon https://raw.githubusercontent.com/OctoNezd/oldlander/main/icons/icon.png // @grant GM.setValue // @grant GM.getValue +// @grant GM_getValue +// @grant GM_setValue // @run-at document-start // ==/UserScript== `;