Skip to content

Commit

Permalink
feat: 添加禁止弹窗脚本
Browse files Browse the repository at this point in the history
  • Loading branch information
enncy committed Mar 27, 2022
1 parent 9a996c3 commit 2b6be41
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ocsjs",
"version": "3.1.11",
"version": "3.2.0",
"description": "ocs - online course script 在线网络课程辅助工具",
"main": "./dist/index.js",
"types": "./packages/scripts/lib/src/index.d.ts",
Expand Down
14 changes: 14 additions & 0 deletions packages/scripts/src/browser/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,20 @@ export const CommonScript = defineScript({
}
},
},
{
name: "禁止弹窗脚本",
url: supports.map((arr) => arr[0]),
start() {
// @ts-ignore
window?.alert = console.log;
// @ts-ignore
unsafeWindow?.alert = console.log;
// @ts-ignore
top?.alert = console.log;
// @ts-ignore
self?.alert = console.log;
},
},
],
panels: [
{
Expand Down

0 comments on commit 2b6be41

Please sign in to comment.