diff options
-rw-r--r-- | yomichan/userscript-loader.js | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/yomichan/userscript-loader.js b/yomichan/userscript-loader.js index b9d9120..729b760 100644 --- a/yomichan/userscript-loader.js +++ b/yomichan/userscript-loader.js @@ -1,6 +1,10 @@ -(async () => eval((await yomichan.api.getSettings([{ - scope: "profile", - optionsContext: { current: true }, - path: 'general.userScript' -}]))[0].result))(); +(async () => { + if (window.location.protocol != "chrome-extension:") return; // only run on yomichan pages + if (window.location.pathname != "/search.html") return; // only run on search page + eval((await yomichan.api.getSettings([{ + scope: "profile", + optionsContext: { current: true }, + path: 'general.userScript' + }]))[0].result); +})(); |