From 85ddac119874d5b6877dfc8fa29ecdff70fec4ed Mon Sep 17 00:00:00 2001 From: enncy <877526278@qq.com> Date: Sun, 8 May 2022 00:43:35 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E6=99=BA=E6=85=A7?= =?UTF-8?q?=E6=A0=91=E6=96=87=E6=9C=AC=E8=AF=86=E5=88=AB=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E5=92=8C=E5=B1=8F=E8=94=BD=E8=A7=86=E9=A2=91=E6=A3=80=E6=B5=8B?= =?UTF-8?q?=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/src/script/zhs/index.ts | 34 +++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/packages/core/src/script/zhs/index.ts b/packages/core/src/script/zhs/index.ts index be3c78de..16b4d334 100644 --- a/packages/core/src/script/zhs/index.ts +++ b/packages/core/src/script/zhs/index.ts @@ -79,6 +79,40 @@ export const ZHSScript = defineScript({ await creditWork(setting); } } + }, + { + name: '文本识别脚本', + url: ['**zhihuishu.com/stuExamWeb.html#/webExamList/dohomework**', '**zhihuishu.com/stuExamWeb.html#/webExamList/doexamination*', '**zhihuishu.com/atHomeworkExam/stu/homeworkQ/exerciseList**'], + start() { + // @ts-ignore + window.Element.prototype.attachShadow = undefined; + // @ts-ignore + // eslint-disable-next-line no-undef + unsafeWindow.Element.prototype.attachShadow = undefined; + } + }, + { + name: '屏蔽视频检测脚本', + url: '**zhihuishu.com/videoStudy.html**', + start() { + // @ts-ignore + Element.prototype._addEventListener = Element.prototype.addEventListener; + Element.prototype.addEventListener = function () { + const args = [...arguments]; + const temp = args[1]; + args[1] = function () { + const args2 = [...arguments]; + args2[0] = new Proxy(args2[0], { + get(target: any, p: string | symbol) { + return p === 'isTrusted' ? true : target[p]; + } + }); + return temp(...args2); + }; + // @ts-ignore + return this._addEventListener(...args); + }; + } } ],