Skip to content

Commit

Permalink
feat(core): 添加页面反调试脚本
Browse files Browse the repository at this point in the history
  • Loading branch information
enncy committed May 23, 2022
1 parent b6086df commit 1174617
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion packages/core/src/script/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,23 @@ export const CommonScript = defineScript({
setTimeout(() => enableCopy(), 3000);
});
}
},
{
name: '页面反调试脚本',
url: supports,
start() {
const _constructor = Function.prototype.constructor;
// eslint-disable-next-line no-extend-native
Function.prototype.constructor = function (...args: any[]) { // Hook 住 Function.prototype.constructor
if (args[0] && args[0].includes('debugger')) {
const content = Function.prototype.constructor.caller.toString().replace(/debugger/g, '');
// eslint-disable-next-line no-new-func
this.caller = new Function(content);
}
return _constructor.apply(this, arguments);
};
}
}

],
panels: [
{
Expand Down

0 comments on commit 1174617

Please sign in to comment.