diff --git a/README.md b/README.md index d34e4bb..52928de 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,16 @@ A `Chrome Extension` and `system proxy` for **disable** the **debugger** functi +## 运行效果 + +- 未使用程序 + +![TurnOff.gif](https://i.loli.net/2020/10/28/YpXkGZhVa5Hi6Lx.gif) + +- 使用程序 + +![TurnOn.gif](https://i.loli.net/2020/10/28/TIqopWDmUzKrO5k.gif) + ## 使用说明 本程序分为两个部分:`chrome浏览器拓展`和`Node系统代理`。 diff --git a/chrome-extension/js/inject.js b/chrome-extension/js/inject.js index db2cda1..addf976 100644 --- a/chrome-extension/js/inject.js +++ b/chrome-extension/js/inject.js @@ -42,20 +42,20 @@ Function.prototype.constructor = (function( oldFn ) { if( arguments[0] !== 'debugger' ){ console.log( arguments ) return oldFn.apply(this, arguments); - } - return false; + }; + // return false; - let args = [...arguments] + let args = [...arguments]; let arg = args[0]; if (arg) { if (arg.includes('debugger')) { arg = annotateDebugger( arg ); args.splice( 0, 1, arg ); successInterception( "constructor", arg ); - } - } + }; + }; return oldFn.apply(this, args); - } + }; })(Function.prototype.constructor); successStart( "拦截方法1" ); @@ -63,7 +63,7 @@ successStart( "拦截方法1" ); Function = (function( oldFn ){ return function(){ console.log( arguments ) - return oldFn.apply( this, arguments ) + // return oldFn.apply( this, arguments ) let args = [...arguments]; let arg = args[args.length-1]; @@ -80,12 +80,14 @@ successStart( "拦截方法2" ); eval = (function( oldFn ){ return function( arg ){ console.log( arguments ) - return oldFn.apply( this, arguments ) + // return oldFn.apply( this, arguments ) if( arg.includes("debugger") ){ arg = annotateDebugger( arg ); successInterception( "eval", arg ); } + console.log( "arg" ) + console.log( arg ) oldFn.call( this, arg ); } })(eval) diff --git a/docs/README_EN.md b/docs/README_EN.md index bc07a13..3eb1c1b 100644 --- a/docs/README_EN.md +++ b/docs/README_EN.md @@ -11,6 +11,17 @@ A `Chrome Extension` and `system proxy` for **disable** the **debugger** functi 一个**禁止**`Chrome DevTools`中执行**debugger**的拓展和`系统代理`。 +## Running Result + +- TurnOff + +![TurnOff.gif](https://raw.githubusercontent.com/kajweb/stop-debugger/main/docs/static/TurnOff.gif) + +- TurnOn + +![TurnOn.gif](https://raw.githubusercontent.com/kajweb/stop-debugger/main/docs/static/TurnOn.gif) + + ## Instructions for use This program is divided into two parts: `chrome browser extension` and `Node system agent`. diff --git a/docs/static/TurnOff.gif b/docs/static/TurnOff.gif new file mode 100644 index 0000000..8a79820 Binary files /dev/null and b/docs/static/TurnOff.gif differ diff --git a/docs/static/TurnOn.gif b/docs/static/TurnOn.gif new file mode 100644 index 0000000..00235d5 Binary files /dev/null and b/docs/static/TurnOn.gif differ diff --git a/proxy-serve/src/core.js b/proxy-serve/src/core.js index 14342a7..598a09c 100644 --- a/proxy-serve/src/core.js +++ b/proxy-serve/src/core.js @@ -48,7 +48,7 @@ function isDocModifiable( contentType ){ function pipeIconv( contentType ){ var characterSet = false; return ( chunk, enc, cb )=>{ - console.log( chunk.toString() ) + // console.log( chunk.toString() ) let data = false; if( !characterSet ){ let charsetObj = Encoding.getCharset( contentType, chunk ); diff --git a/proxy-serve/src/encoding.js b/proxy-serve/src/encoding.js index cf5e4b4..ae8c417 100644 --- a/proxy-serve/src/encoding.js +++ b/proxy-serve/src/encoding.js @@ -39,6 +39,7 @@ function getZlib( contentEncoding ){ break; case '': return { encoding: false }; + break; default: console.log( contentEncoding ) throw new Error("UnKnow content-encoding"); @@ -179,7 +180,7 @@ function getCharsetFromMeta( chunk, characterSetDefault ){ */ function resetCharsetToIconv( charset ){ charset = charset.toLowerCase(); - console.log( `[resetChrasetToIconv] ${charset}` ); + // console.log( `[resetChrasetToIconv] ${charset}` ); return charset; }