feat: 0.2.1

This commit is contained in:
tackchen 2022-01-05 23:43:28 +08:00
parent 00c689e0b7
commit 5c787a48f0
28 changed files with 506 additions and 278 deletions

View File

@ -12,5 +12,6 @@
"plugins": [
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-proposal-object-rest-spread"
// "@babel/plugin-transform-runtime" // 不使用 async/await 是为了减少打包体积
]
}

View File

@ -82,6 +82,7 @@ disable-devtool 可以禁用所有一切可以进入开发者工具的方法,
7. 使用极简、体积小巧 (仅7kb)
8. 支持npm引用和script标签引用(属性配置)
9. 识别真移动端与浏览器开发者工具设置插件伪造的移动端,为移动端节省性能
10. 支持识别开发者工具关闭事件
## 3. 使用
@ -107,14 +108,15 @@ declare interface optionStatic {
url?: string; // 关闭页面失败时的跳转页面默认值为localhost
tkName?: string; // 绕过禁用时的url参数名称默认为 ddtk
ondevtoolopen?(type: DetectorType, next: Function): void; // 开发者面板打开的回调启用时url参数无效type 为监测模式详见3.5
ondevtoolclose?(): void;
interval?: number; // 定时器的时间间隔 默认200ms
disableMenu?: boolean; // 是否禁用右键菜单 默认为true
stopIntervalTime?: number; // 在移动端时取消监视的等待时长
clearIntervalWhenDevOpenTrigger?: boolean; // 是否在触发之后停止监控 默认为false
clearIntervalWhenDevOpenTrigger?: boolean; // 是否在触发之后停止监控 默认为false 在使用ondevtoolclose时该参数无效
detactors?: Array<DETECTOR_TYPE>; // 启用的检测器 检测器详情见 3.5 默认为全部,建议使用全部
}
declare type DETECTOR_TYPE = -1 | 0 | 1 | 2 | 3 | 4; // 检测器详情见 3.5
declare type DETECTOR_TYPE = -1 | 0 | 1 | 2 | 3 | 4 5; // 检测器详情见 3.5
```
### 3.2 md5 与 tk 绕过禁用
@ -176,6 +178,7 @@ const DETECTOR_TYPE = {
SIZE: 2, // 根据窗口尺寸检测
DATE_TO_STRING: 3, // 根据Date.toString 检测
FUNC_TO_STRING: 4, // 根据Function.toString 检测
DEBUGGER: 5; // 根据断点检测仅在ios chrome 真机情况下有效
}
```

View File

@ -81,6 +81,7 @@ The library has the following features:
7. Minimal use, small size (only 7kb)
8. Support npm reference and script tag reference (attribute configuration)
9. Identify the real mobile terminal and browser developer tool settings plug-in forged mobile terminal, saving performance for the mobile terminal
10. Support for identifying developer tool shutdown events
## 3. Use
@ -106,13 +107,14 @@ declare interface optionStatic {
url?: string; // Jump to the page when closing the page fails, the default value is localhost
tkName?: string; // Bypass the url parameter name when disabled, the default is ddtk
ondevtoolopen?(type: DetectorType, next: Function): void; // Callback for opening the developer panel, the url parameter is invalid when it is enabled, and the type is the monitoring mode, see 3.5 for details
ondevtoolclose?(): void;
interval?: number; // Timer interval is 200ms by default
disableMenu?: boolean; // Whether to disable the right-click menu The default is true
clearIntervalWhenDevOpenTrigger?: boolean; // Whether to stop monitoring after triggering The default is false
clearIntervalWhenDevOpenTrigger?: boolean; // Whether to stop monitoring after triggering The default is false. This parameter is invalid when using ondevtoolclose
detactors?: Array<DETECTOR_TYPE>; // Enabled detectors For details of detectors, see 3.5. The default is all, it is recommended to use all
}
declare type DETECTOR_TYPE = -1 | 0 | 1 | 2 | 3 | 4; // For details of the detector, see 3.5
declare type DETECTOR_TYPE = -1 | 0 | 1 | 2 | 3 | 4 5; // For details of the detector, see 3.5
```
### 3.2 md5 and tk bypass disable
@ -174,6 +176,7 @@ const DETECTOR_TYPE = {
SIZE: 2, // Detect according to window size
DATE_TO_STRING: 3, // Check according to Date.toString
FUNC_TO_STRING: 4, // Detect according to Function.toString
DEBUGGER: 5; // According to the breakpoint detection, it is only valid in the case of ios chrome real machine
}
```

View File

@ -78,4 +78,10 @@
1. Add the second parameter of config.ondevtoolopen next
2. Added shortcut key operations for prohibiting reviewing elements and saving web pages
3. Refactor the code
4. Fix the problem caused by the method on the console cannot be cached by ie
4. Fix the problem caused by the method on the console cannot be cached by ie
## 0.2.1
1. Add ondevtoolclose configuration
2. Add isDevToolOpened api
3. Fix the accidental injury problem of ios mobile chrome
4. Added a debug page

View File

@ -79,4 +79,10 @@
1. 增加 config.ondevtoolopen 第二个参数 next
2. 增加 禁止审查元素和保存网页的快捷键操作
3. 重构代码
4. 修复ie不能缓存console上的方法导致的问题
4. 修复ie不能缓存console上的方法导致的问题
## 0.2.1
1. 增加 ondevtoolclose 配置
2. 增加 isDevToolOpened api
3. 修复 ios mobile chrome 的误伤问题
4. 增加了一个debug页面

View File

@ -120,6 +120,7 @@ disableDevtool(options);</code></p>
url?: string; // Jump to the page when closing the page fails, the default value is localhost
tkName?: string; // Bypass the url parameter name when disabled, the default is ddtk
ondevtoolopen?(type: DetectorType): void; // Callback for opening the developer panel, the url parameter is invalid when it is enabled
ondevtoolclose?(): void;
interval?: number; // Timer interval is 200ms by default
disableMenu?: boolean; // Whether to disable the right-click menu The default is true
stopIntervalTime?: number; // Waiting time to cancel monitoring on mobile
@ -127,7 +128,7 @@ disableDevtool(options);</code></p>
detactors?: Array; // Enabled detectors For details of detectors, see 3.5. The default is all, it is recommended to use all
}
declare type DETECTOR_TYPE = -1 | 0 | 1 | 2 | 3;</code></p>
declare type DETECTOR_TYPE = -1 | 0 | 1 | 2 | 3 | 4 | 5;</code></p>
<h3>3.2 md5 and tk bypass disable</h3>
@ -182,7 +183,7 @@ declare type DETECTOR_TYPE = -1 | 0 | 1 | 2 | 3;</code></p>
<script
disable-devtool-auto
md5='1aabac6d068eef6a7bad3fdf50a05cc8'
src='https://cdn.jsdelivr.net/npm/disable-devtool@0.1.12/disable-devtool.min.js#use'
src='https://cdn.jsdelivr.net/npm/disable-devtool@0.2.1/disable-devtool.min.js#use'
></script>
<!-- <script disable-devtool-auto md5='1aabac6d068eef6a7bad3fdf50a05cc8' src='./npm/disable-devtool.min.js'></script> -->
<script>

View File

@ -81,6 +81,7 @@ The library has the following features:
7. Minimal use, small size (only 7kb)
8. Support npm reference and script tag reference (attribute configuration)
9. Identify the real mobile terminal and browser developer tool settings plug-in forged mobile terminal, saving performance for the mobile terminal
10. Support for identifying developer tool shutdown events
## 3. Use
@ -106,13 +107,14 @@ declare interface optionStatic {
url?: string; // Jump to the page when closing the page fails, the default value is localhost
tkName?: string; // Bypass the url parameter name when disabled, the default is ddtk
ondevtoolopen?(type: DetectorType, next: Function): void; // Callback for opening the developer panel, the url parameter is invalid when it is enabled, and the type is the monitoring mode, see 3.5 for details
ondevtoolclose?(): void;
interval?: number; // Timer interval is 200ms by default
disableMenu?: boolean; // Whether to disable the right-click menu The default is true
clearIntervalWhenDevOpenTrigger?: boolean; // Whether to stop monitoring after triggering The default is false
clearIntervalWhenDevOpenTrigger?: boolean; // Whether to stop monitoring after triggering The default is false. This parameter is invalid when using ondevtoolclose
detactors?: Array<DETECTOR_TYPE>; // Enabled detectors For details of detectors, see 3.5. The default is all, it is recommended to use all
}
declare type DETECTOR_TYPE = -1 | 0 | 1 | 2 | 3 | 4; // For details of the detector, see 3.5
declare type DETECTOR_TYPE = -1 | 0 | 1 | 2 | 3 | 4 5; // For details of the detector, see 3.5
```
### 3.2 md5 and tk bypass disable
@ -174,6 +176,7 @@ const DETECTOR_TYPE = {
SIZE: 2, // Detect according to window size
DATE_TO_STRING: 3, // Check according to Date.toString
FUNC_TO_STRING: 4, // Detect according to Function.toString
DEBUGGER: 5; // According to the breakpoint detection, it is only valid in the case of ios chrome real machine
}
```

File diff suppressed because one or more lines are too long

4
npm/index.d.ts vendored
View File

@ -5,6 +5,7 @@ declare interface optionStatic {
url?: string; // 关闭页面失败时的跳转页面默认值为localhost
tkName?: string; // 绕过禁用时的url参数名称默认为 ddtk
ondevtoolopen?(type: DETECTOR_TYPE, next: Function): void; // 开发者面板打开的回调启用时url参数无效
ondevtoolclose?(): void;
interval?: number; // 定时器的时间间隔 默认200ms
disableMenu?: boolean; // 是否禁用右键菜单 默认为true
stopIntervalTime?: number; // 在移动端时取消监视的等待时长
@ -21,10 +22,11 @@ declare interface DDTStatic {
SIZE: 2;
DATE_TO_STRING: 3;
FUNC_TO_STRING: 4;
// DEBUGGER: 5;
DEBUGGER: 5;
// LOG_TIME: 6;
}
version: string;
isDevToolOpened(): boolean;
}
declare const ddt: DDTStatic;

View File

@ -1,6 +1,6 @@
{
"name": "disable-devtool",
"version": "0.1.12",
"version": "0.2.1",
"description": "Disable web developer tools from the f12 button, right-click and browser ",
"main": "disable-devtool.min.js",
"unpkg": "disable-devtool.min.js",

514
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "disable-devtool",
"version": "0.1.11",
"version": "0.2.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "disable-devtool",
"version": "0.1.11",
"version": "0.2.1",
"license": "MIT",
"devDependencies": {
"@babel/core": "^7.6.4",
@ -35,19 +35,25 @@
}
},
"node_modules/@babel/code-frame": {
"version": "7.10.4",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz",
"integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==",
"version": "7.16.7",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz",
"integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==",
"dev": true,
"dependencies": {
"@babel/highlight": "^7.10.4"
"@babel/highlight": "^7.16.7"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/compat-data": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.12.1.tgz",
"integrity": "sha512-725AQupWJZ8ba0jbKceeFblZTY90McUBWMwHhkFQ9q1zKPJ95GUktljFcgcsIVwRnTnRKlcYzfiNImg5G9m6ZQ==",
"dev": true
"version": "7.16.4",
"resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.16.4.tgz",
"integrity": "sha512-1o/jo7D+kC9ZjHX5v+EHrdjl3PhxMrLSOTGsOdHJ+KL8HCaEK6ehrVL2RS6oHDZp+L7xLirLrPmQtEng769J/Q==",
"dev": true,
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/core": {
"version": "7.12.3",
@ -81,14 +87,17 @@
}
},
"node_modules/@babel/generator": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.1.tgz",
"integrity": "sha512-DB+6rafIdc9o72Yc3/Ph5h+6hUjeOp66pF0naQBgUFFuPqzQwIlPTm3xZR7YNvduIMtkDIj2t21LSQwnbCrXvg==",
"version": "7.16.7",
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.16.7.tgz",
"integrity": "sha512-/ST3Sg8MLGY5HVYmrjOgL60ENux/HfO/CsUh7y4MalThufhE/Ff/6EibFDHi4jiDCaWfJKoqbE6oTh21c5hrRg==",
"dev": true,
"dependencies": {
"@babel/types": "^7.12.1",
"@babel/types": "^7.16.7",
"jsesc": "^2.5.1",
"source-map": "^0.5.0"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/helper-annotate-as-pure": {
@ -111,20 +120,32 @@
}
},
"node_modules/@babel/helper-compilation-targets": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.12.1.tgz",
"integrity": "sha512-jtBEif7jsPwP27GPHs06v4WBV0KrE8a/P7n0N0sSvHn2hwUCYnolP/CLmz51IzAW4NlN+HuoBtb9QcwnRo9F/g==",
"version": "7.16.7",
"resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.7.tgz",
"integrity": "sha512-mGojBwIWcwGD6rfqgRXVlVYmPAv7eOpIemUG3dGnDdCY4Pae70ROij3XmfrH6Fa1h1aiDylpglbZyktfzyo/hA==",
"dev": true,
"dependencies": {
"@babel/compat-data": "^7.12.1",
"@babel/helper-validator-option": "^7.12.1",
"browserslist": "^4.12.0",
"semver": "^5.5.0"
"@babel/compat-data": "^7.16.4",
"@babel/helper-validator-option": "^7.16.7",
"browserslist": "^4.17.5",
"semver": "^6.3.0"
},
"engines": {
"node": ">=6.9.0"
},
"peerDependencies": {
"@babel/core": "^7.0.0"
}
},
"node_modules/@babel/helper-compilation-targets/node_modules/semver": {
"version": "6.3.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
"dev": true,
"bin": {
"semver": "bin/semver.js"
}
},
"node_modules/@babel/helper-create-class-features-plugin": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.12.1.tgz",
@ -166,6 +187,18 @@
"lodash": "^4.17.19"
}
},
"node_modules/@babel/helper-environment-visitor": {
"version": "7.16.7",
"resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz",
"integrity": "sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag==",
"dev": true,
"dependencies": {
"@babel/types": "^7.16.7"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/helper-explode-assignable-expression": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.12.1.tgz",
@ -176,32 +209,41 @@
}
},
"node_modules/@babel/helper-function-name": {
"version": "7.10.4",
"resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.10.4.tgz",
"integrity": "sha512-YdaSyz1n8gY44EmN7x44zBn9zQ1Ry2Y+3GTA+3vH6Mizke1Vw0aWDM66FOYEPw8//qKkmqOckrGgTYa+6sceqQ==",
"version": "7.16.7",
"resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.16.7.tgz",
"integrity": "sha512-QfDfEnIUyyBSR3HtrtGECuZ6DAyCkYFp7GHl75vFtTnn6pjKeK0T1DB5lLkFvBea8MdaiUABx3osbgLyInoejA==",
"dev": true,
"dependencies": {
"@babel/helper-get-function-arity": "^7.10.4",
"@babel/template": "^7.10.4",
"@babel/types": "^7.10.4"
"@babel/helper-get-function-arity": "^7.16.7",
"@babel/template": "^7.16.7",
"@babel/types": "^7.16.7"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/helper-get-function-arity": {
"version": "7.10.4",
"resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.10.4.tgz",
"integrity": "sha512-EkN3YDB+SRDgiIUnNgcmiD361ti+AVbL3f3Henf6dqqUyr5dMsorno0lJWJuLhDhkI5sYEpgj6y9kB8AOU1I2A==",
"version": "7.16.7",
"resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.7.tgz",
"integrity": "sha512-flc+RLSOBXzNzVhcLu6ujeHUrD6tANAOU5ojrRx/as+tbzf8+stUCj7+IfRRoAbEZqj/ahXEMsjhOhgeZsrnTw==",
"dev": true,
"dependencies": {
"@babel/types": "^7.10.4"
"@babel/types": "^7.16.7"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/helper-hoist-variables": {
"version": "7.10.4",
"resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.10.4.tgz",
"integrity": "sha512-wljroF5PgCk2juF69kanHVs6vrLwIPNp6DLD+Lrl3hoQ3PpPPikaDRNFA+0t81NOoMt2DL6WW/mdU8k4k6ZzuA==",
"version": "7.16.7",
"resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz",
"integrity": "sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg==",
"dev": true,
"dependencies": {
"@babel/types": "^7.10.4"
"@babel/types": "^7.16.7"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/helper-member-expression-to-functions": {
@ -214,12 +256,15 @@
}
},
"node_modules/@babel/helper-module-imports": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.12.1.tgz",
"integrity": "sha512-ZeC1TlMSvikvJNy1v/wPIazCu3NdOwgYZLIkmIyAsGhqkNpiDoQQRmaCK8YP4Pq3GPTLPV9WXaPCJKvx06JxKA==",
"version": "7.16.7",
"resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz",
"integrity": "sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg==",
"dev": true,
"dependencies": {
"@babel/types": "^7.12.1"
"@babel/types": "^7.16.7"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/helper-module-transforms": {
@ -249,10 +294,13 @@
}
},
"node_modules/@babel/helper-plugin-utils": {
"version": "7.10.4",
"resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz",
"integrity": "sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg==",
"dev": true
"version": "7.16.7",
"resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.16.7.tgz",
"integrity": "sha512-Qg3Nk7ZxpgMrsox6HreY1ZNKdBq7K72tDSliA6dCl5f007jR4ne8iD5UzuNnCJH2xBf2BEEVGr+/OL6Gdp7RxA==",
"dev": true,
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/helper-regex": {
"version": "7.10.5",
@ -305,25 +353,34 @@
}
},
"node_modules/@babel/helper-split-export-declaration": {
"version": "7.11.0",
"resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.11.0.tgz",
"integrity": "sha512-74Vejvp6mHkGE+m+k5vHY93FX2cAtrw1zXrZXRlG4l410Nm9PxfEiVTn1PjDPV5SnmieiueY4AFg2xqhNFuuZg==",
"version": "7.16.7",
"resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz",
"integrity": "sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw==",
"dev": true,
"dependencies": {
"@babel/types": "^7.11.0"
"@babel/types": "^7.16.7"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/helper-validator-identifier": {
"version": "7.10.4",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz",
"integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==",
"dev": true
"version": "7.16.7",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz",
"integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==",
"dev": true,
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/helper-validator-option": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.12.1.tgz",
"integrity": "sha512-YpJabsXlJVWP0USHjnC/AQDTLlZERbON577YUVO/wLpqyj6HAtVYnWaQaN0iUN+1/tWn3c+uKKXjRut5115Y2A==",
"dev": true
"version": "7.16.7",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz",
"integrity": "sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ==",
"dev": true,
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/helper-wrap-function": {
"version": "7.12.3",
@ -349,20 +406,23 @@
}
},
"node_modules/@babel/highlight": {
"version": "7.10.4",
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz",
"integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==",
"version": "7.16.7",
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.7.tgz",
"integrity": "sha512-aKpPMfLvGO3Q97V0qhw/V2SWNWlwfJknuwAunU7wZLSfrM4xTBvg7E5opUVi1kJTBKihE38CPg4nBiqX83PWYw==",
"dev": true,
"dependencies": {
"@babel/helper-validator-identifier": "^7.10.4",
"@babel/helper-validator-identifier": "^7.16.7",
"chalk": "^2.0.0",
"js-tokens": "^4.0.0"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/parser": {
"version": "7.12.3",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.3.tgz",
"integrity": "sha512-kFsOS0IbsuhO5ojF8Hc8z/8vEIOkylVBrjiZUbLTE3XFe0Qi+uu6HjzQixkFaqr0ZPAMZcBVxEwmsnsLPZ2Xsw==",
"version": "7.16.7",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.16.7.tgz",
"integrity": "sha512-sR4eaSrnM7BV7QPzGfEX5paG/6wrZM3I0HDzfIAK06ESvo9oy3xBuVBxE3MbQaKNhvg8g/ixjMWo2CGpzpHsDA==",
"dev": true,
"bin": {
"parser": "bin/babel-parser.js"
@ -1203,42 +1263,51 @@
}
},
"node_modules/@babel/template": {
"version": "7.10.4",
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.10.4.tgz",
"integrity": "sha512-ZCjD27cGJFUB6nmCB1Enki3r+L5kJveX9pq1SvAUKoICy6CZ9yD8xO086YXdYhvNjBdnekm4ZnaP5yC8Cs/1tA==",
"version": "7.16.7",
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.7.tgz",
"integrity": "sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w==",
"dev": true,
"dependencies": {
"@babel/code-frame": "^7.10.4",
"@babel/parser": "^7.10.4",
"@babel/types": "^7.10.4"
"@babel/code-frame": "^7.16.7",
"@babel/parser": "^7.16.7",
"@babel/types": "^7.16.7"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/traverse": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.1.tgz",
"integrity": "sha512-MA3WPoRt1ZHo2ZmoGKNqi20YnPt0B1S0GTZEPhhd+hw2KGUzBlHuVunj6K4sNuK+reEvyiPwtp0cpaqLzJDmAw==",
"version": "7.16.7",
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.16.7.tgz",
"integrity": "sha512-8KWJPIb8c2VvY8AJrydh6+fVRo2ODx1wYBU2398xJVq0JomuLBZmVQzLPBblJgHIGYG4znCpUZUZ0Pt2vdmVYQ==",
"dev": true,
"dependencies": {
"@babel/code-frame": "^7.10.4",
"@babel/generator": "^7.12.1",
"@babel/helper-function-name": "^7.10.4",
"@babel/helper-split-export-declaration": "^7.11.0",
"@babel/parser": "^7.12.1",
"@babel/types": "^7.12.1",
"@babel/code-frame": "^7.16.7",
"@babel/generator": "^7.16.7",
"@babel/helper-environment-visitor": "^7.16.7",
"@babel/helper-function-name": "^7.16.7",
"@babel/helper-hoist-variables": "^7.16.7",
"@babel/helper-split-export-declaration": "^7.16.7",
"@babel/parser": "^7.16.7",
"@babel/types": "^7.16.7",
"debug": "^4.1.0",
"globals": "^11.1.0",
"lodash": "^4.17.19"
"globals": "^11.1.0"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/types": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.1.tgz",
"integrity": "sha512-BzSY3NJBKM4kyatSOWh3D/JJ2O3CVzBybHWxtgxnggaxEuaSTTDqeiSb/xk9lrkw2Tbqyivw5ZU4rT+EfznQsA==",
"version": "7.16.7",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.16.7.tgz",
"integrity": "sha512-E8HuV7FO9qLpx6OtoGfUQ2cjIYnbFwvZWYBS+87EwtdMvmUPJSwykpovFB+8insbpF0uJcpr8KMUi64XZntZcg==",
"dev": true,
"dependencies": {
"@babel/helper-validator-identifier": "^7.10.4",
"lodash": "^4.17.19",
"@babel/helper-validator-identifier": "^7.16.7",
"to-fast-properties": "^2.0.0"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@commitlint/cli": {
@ -2891,15 +2960,16 @@
}
},
"node_modules/browserslist": {
"version": "4.14.5",
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.14.5.tgz",
"integrity": "sha512-Z+vsCZIvCBvqLoYkBFTwEYH3v5MCQbsAjp50ERycpOjnPmolg1Gjy4+KaWWpm8QOJt9GHkhdqAl14NpCX73CWA==",
"version": "4.19.1",
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.19.1.tgz",
"integrity": "sha512-u2tbbG5PdKRTUoctO3NBD8FQ5HdPh1ZXPHzp1rwaa5jTc+RV9/+RlWiAIKmjRPQF+xbGM9Kklj5bZQFa2s/38A==",
"dev": true,
"dependencies": {
"caniuse-lite": "^1.0.30001135",
"electron-to-chromium": "^1.3.571",
"escalade": "^3.1.0",
"node-releases": "^1.1.61"
"caniuse-lite": "^1.0.30001286",
"electron-to-chromium": "^1.4.17",
"escalade": "^3.1.1",
"node-releases": "^2.0.1",
"picocolors": "^1.0.0"
},
"bin": {
"browserslist": "cli.js"
@ -2908,8 +2978,8 @@
"node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7"
},
"funding": {
"type": "tidelift",
"url": "https://tidelift.com/funding/github/npm/browserslist"
"type": "opencollective",
"url": "https://opencollective.com/browserslist"
}
},
"node_modules/buffer": {
@ -3083,10 +3153,14 @@
}
},
"node_modules/caniuse-lite": {
"version": "1.0.30001150",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001150.tgz",
"integrity": "sha512-kiNKvihW0m36UhAFnl7bOAv0i1K1f6wpfVtTF5O5O82XzgtBnb05V0XeV3oZ968vfg2sRNChsHw8ASH2hDfoYQ==",
"dev": true
"version": "1.0.30001296",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001296.tgz",
"integrity": "sha512-WfrtPEoNSoeATDlf4y3QvkwiELl9GyPLISV5GejTbbQRtQx4LhsXmc9IQ6XCL2d7UxCyEzToEZNMeqR79OUw8Q==",
"dev": true,
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/browserslist"
}
},
"node_modules/chalk": {
"version": "2.4.2",
@ -3747,12 +3821,12 @@
"hasInstallScript": true
},
"node_modules/core-js-compat": {
"version": "3.6.5",
"resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.6.5.tgz",
"integrity": "sha512-7ItTKOhOZbznhXAQ2g/slGg1PJV5zDO/WdkTwi7UEOJmkvsE32PWvx6mKtDjiMpjnR2CNf6BAD6sSxIlv7ptng==",
"version": "3.20.2",
"resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.20.2.tgz",
"integrity": "sha512-qZEzVQ+5Qh6cROaTPFLNS4lkvQ6mBzE3R6A6EEpssj7Zr2egMHgsy4XapdifqJDGC9CBiNv7s+ejI96rLNQFdg==",
"dev": true,
"dependencies": {
"browserslist": "^4.8.5",
"browserslist": "^4.19.1",
"semver": "7.0.0"
},
"funding": {
@ -4342,9 +4416,9 @@
"dev": true
},
"node_modules/electron-to-chromium": {
"version": "1.3.582",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.582.tgz",
"integrity": "sha512-0nCJ7cSqnkMC+kUuPs0YgklFHraWGl/xHqtZWWtOeVtyi+YqkoAOMGuZQad43DscXCQI/yizcTa3u6B5r+BLww==",
"version": "1.4.35",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.35.tgz",
"integrity": "sha512-wzTOMh6HGFWeALMI3bif0mzgRrVGyP1BdFRx7IvWukFrSC5QVQELENuy+Fm2dCrAdQH9T3nuqr07n94nPDFBWA==",
"dev": true
},
"node_modules/elegant-spinner": {
@ -9296,9 +9370,9 @@
"dev": true
},
"node_modules/node-releases": {
"version": "1.1.64",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.64.tgz",
"integrity": "sha512-Iec8O9166/x2HRMJyLLLWkd0sFFLrFNy+Xf+JQfSQsdBJzPcHpNl3JQ9gD4j+aJxmCa25jNsIbM4bmACtSbkSg==",
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.1.tgz",
"integrity": "sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA==",
"dev": true
},
"node_modules/normalize-package-data": {
@ -9990,6 +10064,12 @@
"node": ">=0.12"
}
},
"node_modules/picocolors": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz",
"integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==",
"dev": true
},
"node_modules/picomatch": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz",
@ -14103,18 +14183,18 @@
},
"dependencies": {
"@babel/code-frame": {
"version": "7.10.4",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz",
"integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==",
"version": "7.16.7",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz",
"integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==",
"dev": true,
"requires": {
"@babel/highlight": "^7.10.4"
"@babel/highlight": "^7.16.7"
}
},
"@babel/compat-data": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.12.1.tgz",
"integrity": "sha512-725AQupWJZ8ba0jbKceeFblZTY90McUBWMwHhkFQ9q1zKPJ95GUktljFcgcsIVwRnTnRKlcYzfiNImg5G9m6ZQ==",
"version": "7.16.4",
"resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.16.4.tgz",
"integrity": "sha512-1o/jo7D+kC9ZjHX5v+EHrdjl3PhxMrLSOTGsOdHJ+KL8HCaEK6ehrVL2RS6oHDZp+L7xLirLrPmQtEng769J/Q==",
"dev": true
},
"@babel/core": {
@ -14142,12 +14222,12 @@
}
},
"@babel/generator": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.1.tgz",
"integrity": "sha512-DB+6rafIdc9o72Yc3/Ph5h+6hUjeOp66pF0naQBgUFFuPqzQwIlPTm3xZR7YNvduIMtkDIj2t21LSQwnbCrXvg==",
"version": "7.16.7",
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.16.7.tgz",
"integrity": "sha512-/ST3Sg8MLGY5HVYmrjOgL60ENux/HfO/CsUh7y4MalThufhE/Ff/6EibFDHi4jiDCaWfJKoqbE6oTh21c5hrRg==",
"dev": true,
"requires": {
"@babel/types": "^7.12.1",
"@babel/types": "^7.16.7",
"jsesc": "^2.5.1",
"source-map": "^0.5.0"
}
@ -14172,15 +14252,23 @@
}
},
"@babel/helper-compilation-targets": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.12.1.tgz",
"integrity": "sha512-jtBEif7jsPwP27GPHs06v4WBV0KrE8a/P7n0N0sSvHn2hwUCYnolP/CLmz51IzAW4NlN+HuoBtb9QcwnRo9F/g==",
"version": "7.16.7",
"resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.7.tgz",
"integrity": "sha512-mGojBwIWcwGD6rfqgRXVlVYmPAv7eOpIemUG3dGnDdCY4Pae70ROij3XmfrH6Fa1h1aiDylpglbZyktfzyo/hA==",
"dev": true,
"requires": {
"@babel/compat-data": "^7.12.1",
"@babel/helper-validator-option": "^7.12.1",
"browserslist": "^4.12.0",
"semver": "^5.5.0"
"@babel/compat-data": "^7.16.4",
"@babel/helper-validator-option": "^7.16.7",
"browserslist": "^4.17.5",
"semver": "^6.3.0"
},
"dependencies": {
"semver": {
"version": "6.3.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
"dev": true
}
}
},
"@babel/helper-create-class-features-plugin": {
@ -14218,6 +14306,15 @@
"lodash": "^4.17.19"
}
},
"@babel/helper-environment-visitor": {
"version": "7.16.7",
"resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz",
"integrity": "sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag==",
"dev": true,
"requires": {
"@babel/types": "^7.16.7"
}
},
"@babel/helper-explode-assignable-expression": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.12.1.tgz",
@ -14228,32 +14325,32 @@
}
},
"@babel/helper-function-name": {
"version": "7.10.4",
"resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.10.4.tgz",
"integrity": "sha512-YdaSyz1n8gY44EmN7x44zBn9zQ1Ry2Y+3GTA+3vH6Mizke1Vw0aWDM66FOYEPw8//qKkmqOckrGgTYa+6sceqQ==",
"version": "7.16.7",
"resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.16.7.tgz",
"integrity": "sha512-QfDfEnIUyyBSR3HtrtGECuZ6DAyCkYFp7GHl75vFtTnn6pjKeK0T1DB5lLkFvBea8MdaiUABx3osbgLyInoejA==",
"dev": true,
"requires": {
"@babel/helper-get-function-arity": "^7.10.4",
"@babel/template": "^7.10.4",
"@babel/types": "^7.10.4"
"@babel/helper-get-function-arity": "^7.16.7",
"@babel/template": "^7.16.7",
"@babel/types": "^7.16.7"
}
},
"@babel/helper-get-function-arity": {
"version": "7.10.4",
"resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.10.4.tgz",
"integrity": "sha512-EkN3YDB+SRDgiIUnNgcmiD361ti+AVbL3f3Henf6dqqUyr5dMsorno0lJWJuLhDhkI5sYEpgj6y9kB8AOU1I2A==",
"version": "7.16.7",
"resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.7.tgz",
"integrity": "sha512-flc+RLSOBXzNzVhcLu6ujeHUrD6tANAOU5ojrRx/as+tbzf8+stUCj7+IfRRoAbEZqj/ahXEMsjhOhgeZsrnTw==",
"dev": true,
"requires": {
"@babel/types": "^7.10.4"
"@babel/types": "^7.16.7"
}
},
"@babel/helper-hoist-variables": {
"version": "7.10.4",
"resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.10.4.tgz",
"integrity": "sha512-wljroF5PgCk2juF69kanHVs6vrLwIPNp6DLD+Lrl3hoQ3PpPPikaDRNFA+0t81NOoMt2DL6WW/mdU8k4k6ZzuA==",
"version": "7.16.7",
"resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz",
"integrity": "sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg==",
"dev": true,
"requires": {
"@babel/types": "^7.10.4"
"@babel/types": "^7.16.7"
}
},
"@babel/helper-member-expression-to-functions": {
@ -14266,12 +14363,12 @@
}
},
"@babel/helper-module-imports": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.12.1.tgz",
"integrity": "sha512-ZeC1TlMSvikvJNy1v/wPIazCu3NdOwgYZLIkmIyAsGhqkNpiDoQQRmaCK8YP4Pq3GPTLPV9WXaPCJKvx06JxKA==",
"version": "7.16.7",
"resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz",
"integrity": "sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg==",
"dev": true,
"requires": {
"@babel/types": "^7.12.1"
"@babel/types": "^7.16.7"
}
},
"@babel/helper-module-transforms": {
@ -14301,9 +14398,9 @@
}
},
"@babel/helper-plugin-utils": {
"version": "7.10.4",
"resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz",
"integrity": "sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg==",
"version": "7.16.7",
"resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.16.7.tgz",
"integrity": "sha512-Qg3Nk7ZxpgMrsox6HreY1ZNKdBq7K72tDSliA6dCl5f007jR4ne8iD5UzuNnCJH2xBf2BEEVGr+/OL6Gdp7RxA==",
"dev": true
},
"@babel/helper-regex": {
@ -14357,24 +14454,24 @@
}
},
"@babel/helper-split-export-declaration": {
"version": "7.11.0",
"resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.11.0.tgz",
"integrity": "sha512-74Vejvp6mHkGE+m+k5vHY93FX2cAtrw1zXrZXRlG4l410Nm9PxfEiVTn1PjDPV5SnmieiueY4AFg2xqhNFuuZg==",
"version": "7.16.7",
"resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz",
"integrity": "sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw==",
"dev": true,
"requires": {
"@babel/types": "^7.11.0"
"@babel/types": "^7.16.7"
}
},
"@babel/helper-validator-identifier": {
"version": "7.10.4",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz",
"integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==",
"version": "7.16.7",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz",
"integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==",
"dev": true
},
"@babel/helper-validator-option": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.12.1.tgz",
"integrity": "sha512-YpJabsXlJVWP0USHjnC/AQDTLlZERbON577YUVO/wLpqyj6HAtVYnWaQaN0iUN+1/tWn3c+uKKXjRut5115Y2A==",
"version": "7.16.7",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz",
"integrity": "sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ==",
"dev": true
},
"@babel/helper-wrap-function": {
@ -14401,20 +14498,20 @@
}
},
"@babel/highlight": {
"version": "7.10.4",
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz",
"integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==",
"version": "7.16.7",
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.7.tgz",
"integrity": "sha512-aKpPMfLvGO3Q97V0qhw/V2SWNWlwfJknuwAunU7wZLSfrM4xTBvg7E5opUVi1kJTBKihE38CPg4nBiqX83PWYw==",
"dev": true,
"requires": {
"@babel/helper-validator-identifier": "^7.10.4",
"@babel/helper-validator-identifier": "^7.16.7",
"chalk": "^2.0.0",
"js-tokens": "^4.0.0"
}
},
"@babel/parser": {
"version": "7.12.3",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.3.tgz",
"integrity": "sha512-kFsOS0IbsuhO5ojF8Hc8z/8vEIOkylVBrjiZUbLTE3XFe0Qi+uu6HjzQixkFaqr0ZPAMZcBVxEwmsnsLPZ2Xsw==",
"version": "7.16.7",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.16.7.tgz",
"integrity": "sha512-sR4eaSrnM7BV7QPzGfEX5paG/6wrZM3I0HDzfIAK06ESvo9oy3xBuVBxE3MbQaKNhvg8g/ixjMWo2CGpzpHsDA==",
"dev": true
},
"@babel/plugin-proposal-async-generator-functions": {
@ -15069,41 +15166,41 @@
}
},
"@babel/template": {
"version": "7.10.4",
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.10.4.tgz",
"integrity": "sha512-ZCjD27cGJFUB6nmCB1Enki3r+L5kJveX9pq1SvAUKoICy6CZ9yD8xO086YXdYhvNjBdnekm4ZnaP5yC8Cs/1tA==",
"version": "7.16.7",
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.7.tgz",
"integrity": "sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.10.4",
"@babel/parser": "^7.10.4",
"@babel/types": "^7.10.4"
"@babel/code-frame": "^7.16.7",
"@babel/parser": "^7.16.7",
"@babel/types": "^7.16.7"
}
},
"@babel/traverse": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.1.tgz",
"integrity": "sha512-MA3WPoRt1ZHo2ZmoGKNqi20YnPt0B1S0GTZEPhhd+hw2KGUzBlHuVunj6K4sNuK+reEvyiPwtp0cpaqLzJDmAw==",
"version": "7.16.7",
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.16.7.tgz",
"integrity": "sha512-8KWJPIb8c2VvY8AJrydh6+fVRo2ODx1wYBU2398xJVq0JomuLBZmVQzLPBblJgHIGYG4znCpUZUZ0Pt2vdmVYQ==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.10.4",
"@babel/generator": "^7.12.1",
"@babel/helper-function-name": "^7.10.4",
"@babel/helper-split-export-declaration": "^7.11.0",
"@babel/parser": "^7.12.1",
"@babel/types": "^7.12.1",
"@babel/code-frame": "^7.16.7",
"@babel/generator": "^7.16.7",
"@babel/helper-environment-visitor": "^7.16.7",
"@babel/helper-function-name": "^7.16.7",
"@babel/helper-hoist-variables": "^7.16.7",
"@babel/helper-split-export-declaration": "^7.16.7",
"@babel/parser": "^7.16.7",
"@babel/types": "^7.16.7",
"debug": "^4.1.0",
"globals": "^11.1.0",
"lodash": "^4.17.19"
"globals": "^11.1.0"
}
},
"@babel/types": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.1.tgz",
"integrity": "sha512-BzSY3NJBKM4kyatSOWh3D/JJ2O3CVzBybHWxtgxnggaxEuaSTTDqeiSb/xk9lrkw2Tbqyivw5ZU4rT+EfznQsA==",
"version": "7.16.7",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.16.7.tgz",
"integrity": "sha512-E8HuV7FO9qLpx6OtoGfUQ2cjIYnbFwvZWYBS+87EwtdMvmUPJSwykpovFB+8insbpF0uJcpr8KMUi64XZntZcg==",
"dev": true,
"requires": {
"@babel/helper-validator-identifier": "^7.10.4",
"lodash": "^4.17.19",
"@babel/helper-validator-identifier": "^7.16.7",
"to-fast-properties": "^2.0.0"
}
},
@ -16505,15 +16602,16 @@
}
},
"browserslist": {
"version": "4.14.5",
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.14.5.tgz",
"integrity": "sha512-Z+vsCZIvCBvqLoYkBFTwEYH3v5MCQbsAjp50ERycpOjnPmolg1Gjy4+KaWWpm8QOJt9GHkhdqAl14NpCX73CWA==",
"version": "4.19.1",
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.19.1.tgz",
"integrity": "sha512-u2tbbG5PdKRTUoctO3NBD8FQ5HdPh1ZXPHzp1rwaa5jTc+RV9/+RlWiAIKmjRPQF+xbGM9Kklj5bZQFa2s/38A==",
"dev": true,
"requires": {
"caniuse-lite": "^1.0.30001135",
"electron-to-chromium": "^1.3.571",
"escalade": "^3.1.0",
"node-releases": "^1.1.61"
"caniuse-lite": "^1.0.30001286",
"electron-to-chromium": "^1.4.17",
"escalade": "^3.1.1",
"node-releases": "^2.0.1",
"picocolors": "^1.0.0"
}
},
"buffer": {
@ -16661,9 +16759,9 @@
}
},
"caniuse-lite": {
"version": "1.0.30001150",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001150.tgz",
"integrity": "sha512-kiNKvihW0m36UhAFnl7bOAv0i1K1f6wpfVtTF5O5O82XzgtBnb05V0XeV3oZ968vfg2sRNChsHw8ASH2hDfoYQ==",
"version": "1.0.30001296",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001296.tgz",
"integrity": "sha512-WfrtPEoNSoeATDlf4y3QvkwiELl9GyPLISV5GejTbbQRtQx4LhsXmc9IQ6XCL2d7UxCyEzToEZNMeqR79OUw8Q==",
"dev": true
},
"chalk": {
@ -17220,12 +17318,12 @@
"dev": true
},
"core-js-compat": {
"version": "3.6.5",
"resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.6.5.tgz",
"integrity": "sha512-7ItTKOhOZbznhXAQ2g/slGg1PJV5zDO/WdkTwi7UEOJmkvsE32PWvx6mKtDjiMpjnR2CNf6BAD6sSxIlv7ptng==",
"version": "3.20.2",
"resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.20.2.tgz",
"integrity": "sha512-qZEzVQ+5Qh6cROaTPFLNS4lkvQ6mBzE3R6A6EEpssj7Zr2egMHgsy4XapdifqJDGC9CBiNv7s+ejI96rLNQFdg==",
"dev": true,
"requires": {
"browserslist": "^4.8.5",
"browserslist": "^4.19.1",
"semver": "7.0.0"
},
"dependencies": {
@ -17720,9 +17818,9 @@
"dev": true
},
"electron-to-chromium": {
"version": "1.3.582",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.582.tgz",
"integrity": "sha512-0nCJ7cSqnkMC+kUuPs0YgklFHraWGl/xHqtZWWtOeVtyi+YqkoAOMGuZQad43DscXCQI/yizcTa3u6B5r+BLww==",
"version": "1.4.35",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.35.tgz",
"integrity": "sha512-wzTOMh6HGFWeALMI3bif0mzgRrVGyP1BdFRx7IvWukFrSC5QVQELENuy+Fm2dCrAdQH9T3nuqr07n94nPDFBWA==",
"dev": true
},
"elegant-spinner": {
@ -21667,9 +21765,9 @@
}
},
"node-releases": {
"version": "1.1.64",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.64.tgz",
"integrity": "sha512-Iec8O9166/x2HRMJyLLLWkd0sFFLrFNy+Xf+JQfSQsdBJzPcHpNl3JQ9gD4j+aJxmCa25jNsIbM4bmACtSbkSg==",
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.1.tgz",
"integrity": "sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA==",
"dev": true
},
"normalize-package-data": {
@ -22200,6 +22298,12 @@
"sha.js": "^2.4.8"
}
},
"picocolors": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz",
"integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==",
"dev": true
},
"picomatch": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz",

View File

@ -1,6 +1,6 @@
{
"name": "disable-devtool",
"version": "0.1.12",
"version": "0.2.1",
"description": "Disable web developer tools from the f12 button, right-click and browser ",
"main": "disable-devtool.min.js",
"unpkg": "disable-devtool.min.js",
@ -54,7 +54,6 @@
"webpack-cli": "^3.3.9",
"webpack-dev-server": "^3.8.2"
},
"dependencies": {},
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"

View File

@ -11,6 +11,13 @@ disableDevtool({
// next();
// console.log(next);
},
ondevtoolclose: () => {
// window.location.href = 'https://www.qq.com';
document.body.innerHTML = 'devtool closed!;';
// next();
// console.log(next);
},
clearIntervalWhenDevOpenTrigger: true,
interval: 1000,
// tkName: 'ddtk',
@ -18,6 +25,9 @@ disableDevtool({
// url: 'https://www.baidu.com'
// detectors: [disableDevtool.DETECTOR_TYPE.DATE_TO_STRING],
});
document.addEventListener('click', () => {
alert(disableDevtool.isDevToolOpened());
});
// console.log(disableDevtool.version);
// console.log(disableDevtool.md5('xx'));

View File

@ -2,7 +2,7 @@
* @Author: tackchen
* @Date: 2021-11-15 22:26:57
* @LastEditors: tackchen
* @LastEditTime: 2022-01-05 09:02:19
* @LastEditTime: 2022-01-05 22:40:41
* @FilePath: /disable-devtool/src/detector/date-to-string.js
* @Description: Coding something
*/
@ -13,6 +13,7 @@ import {clearLog, log} from '../utils/log';
export default function detector (isTrueIOSChrome) {
if (isTrueIOSChrome) return;
const type = DETECTOR_TYPE.DATE_TO_STRING;
let count = 0;
const date = new Date();
date.toString = () => {
@ -25,9 +26,9 @@ export default function detector (isTrueIOSChrome) {
log(date);
clearLog();
if (count >= 2) {
triggerOnDevOpen(DETECTOR_TYPE.DATE_TO_STRING);
triggerOnDevOpen(type);
}
};
registInterval(checkIsOpen);
registInterval(type, checkIsOpen);
}

View File

@ -2,7 +2,7 @@
* @Author: tackchen
* @Date: 2021-11-15 22:26:57
* @LastEditors: tackchen
* @LastEditTime: 2022-01-05 09:06:30
* @LastEditTime: 2022-01-05 22:38:55
* @FilePath: /disable-devtool/src/detector/debugger.js
* @Description: Coding something
*/
@ -12,12 +12,13 @@ import {DETECTOR_TYPE, triggerOnDevOpen} from './detector';
export default function detector (isTrueIOSChrome) {
if (isTrueIOSChrome) {
const type = DETECTOR_TYPE.DEBUGGER;
// 仅在 ios chrome 下生效
registInterval(() => {
registInterval(type, () => {
const date = Date.now();
(() => {debugger;})();
if (Date.now() - date > 100) {
triggerOnDevOpen(DETECTOR_TYPE.DEBUGGER);
triggerOnDevOpen(type);
}
});
}

View File

@ -10,16 +10,17 @@ import {registInterval} from '../utils/interval';
import {log} from '../utils/log';
export default function detector () {
const type = DETECTOR_TYPE.DEFINE_ID;
const div = document.createElement('div');
div.__defineGetter__('id', function () {
triggerOnDevOpen(DETECTOR_TYPE.DEFINE_ID);
triggerOnDevOpen(type);
});
Object.defineProperty(div, 'id', {
get: function () {
triggerOnDevOpen(DETECTOR_TYPE.DEFINE_ID);
triggerOnDevOpen(type);
},
});
registInterval(() => {
registInterval(type, () => {
log(div);
});
}

View File

@ -2,7 +2,7 @@
* @Author: theajack
* @Date: 2021-07-24 23:16:34
* @LastEditor: theajack
* @LastEditTime: 2022-01-05 12:38:04
* @LastEditTime: 2022-01-05 23:39:06
* @Description: Coding something
*/
@ -17,6 +17,7 @@ import DebuggerDetector from './debugger';
import {clearDDInterval, clearDDTimeout} from '../utils/interval';
import {closeWindow} from '../utils/close-window';
import {isIOSChrome, isLogRegExpCount3} from '../utils/util';
import {isDevToolOpened, isLastStateOpened, markDevToolOpenState} from '../utils/open-state';
export const DETECTOR_TYPE = {
UNKONW: -1,
@ -25,7 +26,7 @@ export const DETECTOR_TYPE = {
SIZE: 2,
DATE_TO_STRING: 3,
FUNC_TO_STRING: 4,
// DEBUGGER: 5,
DEBUGGER: 5,
// LOG_TIME: 6,
};
@ -35,26 +36,36 @@ const Detectors = {
[DETECTOR_TYPE.SIZE]: SizeDetector,
[DETECTOR_TYPE.DATE_TO_STRING]: DateToStringDetector,
[DETECTOR_TYPE.FUNC_TO_STRING]: FuncToStringDetector,
// [DETECTOR_TYPE.DEBUGGER]: DebuggerDetector,
[DETECTOR_TYPE.DEBUGGER]: DebuggerDetector,
// [DETECTOR_TYPE.LOG_TIME]: LogTimeDetector,
};
export async function initDetectors () {
export function initDetectors () {
// ! 判断是否是 ios chrome 真机, true时 禁用 date 和 func detector因为会误伤。启用debugger detector兜底
const isTrueIOSChrome = isIOSChrome && (await isLogRegExpCount3());
// 不使用 async/await 是为了减少打包体积
const initFunc = (isTrueIOSChrome) => {
const typeArray = config.detectors === 'all' ?
Object.keys(Detectors) : config.detectors;
const typeArray = config.detectors === 'all' ?
Object.keys(Detectors) : config.detectors;
if (isTrueIOSChrome) {
typeArray.push(DebuggerDetector); // 会debuger显示devtool, 仅在ios chrome 真机生效
}
typeArray.forEach(type => {
if (Detectors[type]) {
Detectors[type](isTrueIOSChrome);
if (isTrueIOSChrome) {
typeArray.push(DETECTOR_TYPE.DEBUGGER); // 会debuger显示devtool, 仅在ios chrome 真机生效
}
});
typeArray.forEach(type => {
if (Detectors[type]) {
Detectors[type](isTrueIOSChrome);
}
});
};
if (!isIOSChrome) {
initFunc(false);
} else {
isLogRegExpCount3().then(bool => {
initFunc(bool);
});
}
}
export function triggerOnDevOpen (type = DETECTOR_TYPE.UNKONW) {
@ -65,4 +76,16 @@ export function triggerOnDevOpen (type = DETECTOR_TYPE.UNKONW) {
}
clearDDTimeout();
config.ondevtoolopen(type, closeWindow);
markDevToolOpenState(type);
}
export function checkOnDevClose () {
if (
typeof config.ondevtoolclose === 'function'
) {
const lastStateOpen = isLastStateOpened();
if (!isDevToolOpened() && lastStateOpen) {
config.ondevtoolclose();
}
}
}

View File

@ -2,7 +2,7 @@
* @Author: tackchen
* @Date: 2021-11-15 22:26:57
* @LastEditors: tackchen
* @LastEditTime: 2022-01-05 08:08:02
* @LastEditTime: 2022-01-05 22:39:48
* @FilePath: /disable-devtool/src/detector/func-to-string.js
* @Description: Coding something
*/
@ -15,6 +15,7 @@ import {log, clearLog} from '../utils/log';
export default function detector (isTrueIOSChrome) {
if (isTrueIOSChrome) return;
const type = DETECTOR_TYPE.FUNC_TO_STRING;
let count = 0;
const func = () => {};
func.toString = () => {
@ -27,9 +28,9 @@ export default function detector (isTrueIOSChrome) {
log(func);
clearLog();
if (count >= 2) {
triggerOnDevOpen(DETECTOR_TYPE.FUNC_TO_STRING);
triggerOnDevOpen(type);
}
};
registInterval(checkIsOpen);
registInterval(type, checkIsOpen);
}

View File

@ -11,6 +11,7 @@
// import {log, clearLog} from '../utils/log';
// function logTime () {
// const type = DETECTOR_TYPE.LOG_TIME;
// const d = new Date();
// for (let i = 0; i < 2000; i++) {
// log(1);
@ -18,12 +19,12 @@
// clearLog();
// if (new Date() - d > 100) {
// console.warn(new Date() - d);
// triggerOnDevOpen(DETECTOR_TYPE.LOG_TIME);
// triggerOnDevOpen(type);
// }
// }
// export default function detector () {
// registInterval((time) => {
// registInterval(type, (time) => {
// if (time % 5 === 0) {
// logTime();
// }

View File

@ -2,7 +2,7 @@
* @Author: theajack
* @Date: 2021-07-24 23:15:01
* @LastEditor: theajack
* @LastEditTime: 2021-12-24 13:19:18
* @LastEditTime: 2022-01-05 22:40:36
* @Description: Coding something
*/
@ -16,6 +16,7 @@ export default function detector () {
const isQQ = isQQBrowser;
const isFF = isFirefox;
if (!isQQ && !isFF) return;
const type = DETECTOR_TYPE.REG_TO_STRING;
let lastTime = 0;
const reg = /./;
log(reg);
@ -23,17 +24,17 @@ export default function detector () {
if (isQQ) { // ! qq浏览器在控制台没有打开的时候也会触发 打开的时候会连续触发两次 使用这个来判断
const time = new Date().getTime();
if (lastTime && time - lastTime < 100) {
triggerOnDevOpen(DETECTOR_TYPE.REG_TO_STRING);
triggerOnDevOpen(type);
} else {
lastTime = time;
}
} else if (isFF) {
triggerOnDevOpen(DETECTOR_TYPE.REG_TO_STRING);
triggerOnDevOpen(type);
}
return '';
};
registInterval(() => {
registInterval(type, () => {
log(reg);
});
}

View File

@ -2,11 +2,12 @@
* @Author: theajack
* @Date: 2021-07-24 23:15:54
* @LastEditor: theajack
* @LastEditTime: 2021-12-24 15:18:29
* @LastEditTime: 2022-01-05 22:42:23
* @Description: Coding something
* @FilePath: /disable-devtool/src/detector/size.js
*/
import {clearDevToolOpenState} from '../utils/open-state';
import {isInIframe} from '../utils/util';
import {DETECTOR_TYPE, triggerOnDevOpen} from './detector';
@ -15,12 +16,14 @@ function checkWindowSizeUneven () {
if (screenRatio === false) { // 如果获取不到屏幕缩放尺寸 则不启用sizeDetector
return true;
}
const type = DETECTOR_TYPE.SIZE;
const widthUneven = window.outerWidth - window.innerWidth * screenRatio > 200; // 调大一点防止误伤
const heightUneven = window.outerHeight - window.innerHeight * screenRatio > 300; // 调大一点防止误伤
if (widthUneven || heightUneven) {
triggerOnDevOpen(DETECTOR_TYPE.SIZE);
triggerOnDevOpen(type);
return false;
}
clearDevToolOpenState(type);
return true;
}

4
src/index.d.ts vendored
View File

@ -5,6 +5,7 @@ declare interface optionStatic {
url?: string; // 关闭页面失败时的跳转页面默认值为localhost
tkName?: string; // 绕过禁用时的url参数名称默认为 ddtk
ondevtoolopen?(type: DETECTOR_TYPE, next: Function): void; // 开发者面板打开的回调启用时url参数无效
ondevtoolclose?(): void;
interval?: number; // 定时器的时间间隔 默认200ms
disableMenu?: boolean; // 是否禁用右键菜单 默认为true
stopIntervalTime?: number; // 在移动端时取消监视的等待时长
@ -21,10 +22,11 @@ declare interface DDTStatic {
SIZE: 2;
DATE_TO_STRING: 3;
FUNC_TO_STRING: 4;
// DEBUGGER: 5;
DEBUGGER: 5;
// LOG_TIME: 6;
}
version: string;
isDevToolOpened(): boolean;
}
declare const ddt: DDTStatic;

View File

@ -6,6 +6,7 @@ import {mergeConfig, config} from './utils/config';
import md5 from './utils/md5';
import version from './version';
import {DETECTOR_TYPE, initDetectors} from './detector/detector';
import {isDevToolOpened} from './utils/open-state';
export function disableDevtool (opts) {
mergeConfig(opts);
@ -18,6 +19,7 @@ export function disableDevtool (opts) {
disableDevtool.md5 = md5;
disableDevtool.version = version;
disableDevtool.DETECTOR_TYPE = DETECTOR_TYPE;
disableDevtool.isDevToolOpened = isDevToolOpened;
function checkTk () {
if (config.md5) { // 启用了 md5

View File

@ -3,6 +3,7 @@ import {closeWindow} from './close-window';
export const config = {
md5: '',
ondevtoolopen: closeWindow, // ondevtoolopen 优先级高于 url
ondevtoolclose: null, // ondevtoolclose 监听
url: '',
tkName: 'ddtk',
interval: 200,
@ -12,15 +13,26 @@ export const config = {
detectors: 'all',
};
const MultiTypeKeys = ['detectors'];
const MultiTypeKeys = ['detectors', 'ondevtoolclose'];
export function mergeConfig (opts = {}) {
for (const k in config) {
if (
typeof opts[k] !== 'undefined' &&
(typeof config[k] === typeof opts[k] || MultiTypeKeys.includes(k))
(typeof config[k] === typeof opts[k] || MultiTypeKeys.indexOf(k) !== -1)
) {
config[k] = opts[k];
}
}
checkConfig();
}
function checkConfig () {
if (
typeof config.ondevtoolclose === 'function' &&
config.clearIntervalWhenDevOpenTrigger === true
) {
config.clearIntervalWhenDevOpenTrigger = false;
console.warn('【DISABLE-DEVTOOL】clearIntervalWhenDevOpenTrigger 在使用 ondevtoolclose 时无效');
}
}

View File

@ -1,5 +1,7 @@
import {checkOnDevClose} from '../detector/detector';
import {config} from './config';
import {clearLog} from './log';
import {clearDevToolOpenState} from './open-state';
import {hackAlert, isPC, onPageShowHide} from './util';
let interval = null, timer = null;
@ -15,8 +17,12 @@ export function initInterval () {
interval = window.setInterval(() => {
if (_pause) return;
calls.forEach(fn => {fn(time++);});
calls.forEach(({type, handle}) => {
clearDevToolOpenState(type);
handle(time++);
});
clearLog();
checkOnDevClose();
}, config.interval);
// stopIntervalTime 之后判断 如果不是pc去掉定时器interval为了优化移动端的性能
// 如果控制面板被打开了该定时器timer会被清除
@ -27,8 +33,8 @@ export function initInterval () {
}, config.stopIntervalTime);
}
export function registInterval (fn) {
calls.push(fn);
export function registInterval (type, handle) {
calls.push({type, handle});
}
export function clearDDInterval () {

41
src/utils/open-state.js Normal file
View File

@ -0,0 +1,41 @@
/*
* @Author: tackchen
* @Date: 2022-01-05 22:27:40
* @LastEditors: tackchen
* @LastEditTime: 2022-01-05 23:14:21
* @FilePath: /disable-devtool/src/utils/open-state.js
* @Description: Coding something
*/
import {DETECTOR_TYPE} from '../detector/detector';
let isLastStateOpenedBool = false;
export function isLastStateOpened () {
return isLastStateOpenedBool;
}
const OpenState = {};
for (const k in DETECTOR_TYPE) {
OpenState[DETECTOR_TYPE[k]] = false;
}
export function markDevToolOpenState (type) {
OpenState[type] = true;
}
export function clearDevToolOpenState (type) {
OpenState[type] = false;
}
export function isDevToolOpened () {
for (const key in OpenState) {
if (OpenState[key]) {
isLastStateOpenedBool = true;
return true;
}
}
isLastStateOpenedBool = false;
return false;
}

View File

@ -110,22 +110,17 @@ export const isIE = isOldEdge || hasUaName('trident') || hasUaName('msie');
export const isIOSChrome = hasUaName('crios');
// ios chrome log regExp count=3 以此区别真机和开发者工具模拟的
export async function isLogRegExpCount3 () {
let count = 0;
const target = new RegExp();
target.toString = () => {
count ++;
return '';
};
log(target);
await delay(100);
return count === 3;
}
export function delay (time = 1000) {
export function isLogRegExpCount3 () {
return new Promise((resolve) => {
let count = 0;
const target = new RegExp();
target.toString = () => {
count ++;
return '';
};
log(target);
setTimeout(() => {
resolve();
}, time);
resolve(count === 3);
}, 100);
});
}

View File

@ -1 +1 @@
export default '0.1.12';
export default '0.2.1';