Skip to content

Commit

Permalink
fix(core): 移除页面反调试脚本至超星
Browse files Browse the repository at this point in the history
  • Loading branch information
enncy committed May 30, 2022
1 parent 6486ede commit 77cb19c
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions packages/core/src/script/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const CommonScript = defineScript({
{
name: '禁止弹窗脚本',
url: supports,
start() {
onstart() {
try {
// @ts-ignore
if (typeof unsafeWindow !== 'undefined') {
Expand All @@ -29,7 +29,7 @@ export const CommonScript = defineScript({
{
name: '开启页面复制粘贴功能',
url: supports,
start() {
onstart() {
function enableCopy() {
try {
const d = document;
Expand Down Expand Up @@ -58,22 +58,6 @@ 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 77cb19c

Please sign in to comment.