From 3fba2e3f394901ab08f37bf6e4930e66ec402ee0 Mon Sep 17 00:00:00 2001 From: cilame Date: Sat, 23 Oct 2021 21:11:07 +0800 Subject: [PATCH] add --- inject.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/inject.js b/inject.js index e6b2a29..8d100c7 100644 --- a/inject.js +++ b/inject.js @@ -27,8 +27,6 @@ function injectfunc(e, window) { saf=function(n,m){return r(n,i,`function ${m?m:n.name||""}() { [native code] }`),n;}; }(); - if (e["config-hook-global"]) { - }else{return} if (e["config-hook-test"]) { debugger } @@ -435,8 +433,10 @@ function inject_script(code){ } chrome.storage.local.get(hookers, function (result) { - var replacer_injectfunc = (injectfunc + '').replace('$domobj_placeholder', make_domhooker_funcs()) - inject_script(`(${replacer_injectfunc})(${JSON.stringify(result)},window)`); + if (result["config-hook-global"]){ + var replacer_injectfunc = (injectfunc + '').replace('$domobj_placeholder', make_domhooker_funcs()) + inject_script(`(${replacer_injectfunc})(${JSON.stringify(result)},window)`); + } }) chrome.extension.onMessage.addListener(function(msg, sender, sendResponse) {