Stops most anti-debugging implementations by JavaScript obfuscators and stops the console logs from being automatically cleared.
Thanks I haven't noticed this script giving any bugs on any websites though...
I tried the codes below, and the include error was fixed, but then I ran into another problem
Bug 1 Fix:
// Change this line:
if (callerContent.includes(/\bdebugger\b/gi)) {
// To this:
if (typeof callerContent === 'string' && callerContent.includes('debugger')) {
Bug 2 Fix:
// Add this code after line 24:
const _Function = unsafeWindow.Function;
unsafeWindow.Function = function() {
if (arguments[0] && arguments[0].includes('debugger')) {
return function() {};
}
return _Function.apply(this, arguments);
};
[BUG] There are some bugs that affect usage
the demo page is here
(I'm sorry but I couldn't beautify my issue content because most HTML style is not allowed in GF)
Steps to reproduce
Bug is caused by
Line 32 As the MDN Web Docs said, String.prototype.includes is not allowed to pass an argument which is a RegExp. It should be considered to use other ways to do this.
Importance
This bug affects some normal app logic in some website.
Steps to reproduce
Function('debugger')/* No "new" keyword is used*/
Bug is caused by
The script overrided
Function.prototype.constructor
but keptFunction
itself.How to fix (my personal opinion)
override
Function
Example
the demo page is here. Learn more by opening DevTools on that page.