feat: 0.1.5

This commit is contained in:
theajack 2021-07-27 23:40:50 +08:00
parent 8c888fe71d
commit 2d986cf12a
14 changed files with 51 additions and 39 deletions

View File

@ -171,7 +171,6 @@ const DETECTOR_TYPE = {
TO_STRING: 0,
DEFINE_ID: 1,
SIZE: 2,
LOG_TIME: 3,
}
```

View File

@ -170,7 +170,6 @@ const DETECTOR_TYPE = {
TO_STRING: 0,
DEFINE_ID: 1,
SIZE: 2,
LOG_TIME: 3,
}
```

View File

@ -50,4 +50,8 @@
1. 增加 detector增加多种监测模式
2. 使用logTime模式兜底兼容maclinux
3. 增加 clearIntervalWhenDevOpenTrigger 参数
4. ondevtoolopen 增加 监测模式 回调参数
4. ondevtoolopen 增加 监测模式 回调参数
## 0.1.5
1. 去掉log-time监测类型因为不准确

View File

@ -181,7 +181,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.4/disable-devtool.min.js#use'
src='https://cdn.jsdelivr.net/npm/disable-devtool@0.1.5/disable-devtool.min.js#use'
></script>
<!-- <script disable-devtool-auto md5='1aabac6d068eef6a7bad3fdf50a05cc8' src='./npm/disable-devtool.min.js'></script> -->
<script>

View File

@ -171,7 +171,6 @@ const DETECTOR_TYPE = {
TO_STRING: 0,
DEFINE_ID: 1,
SIZE: 2,
LOG_TIME: 3,
}
```

View File

@ -170,7 +170,6 @@ const DETECTOR_TYPE = {
TO_STRING: 0,
DEFINE_ID: 1,
SIZE: 2,
LOG_TIME: 3,
}
```

File diff suppressed because one or more lines are too long

4
npm/index.d.ts vendored
View File

@ -1,5 +1,5 @@
declare type DETECTOR_TYPE = -1 | 0 | 1 | 2 | 3;
declare type DETECTOR_TYPE = -1 | 0 | 1 | 2;
declare interface optionStatic {
md5?: string; // 绕过禁用的md5值详情见3.2,默认不启用绕过禁用
url?: string; // 关闭页面失败时的跳转页面默认值为localhost
@ -18,7 +18,7 @@ declare interface DDTStatic {
TO_STRING: 0;
DEFINE_ID: 1;
SIZE: 2;
LOG_TIME: 3;
// LOG_TIME: 3;
}
version: string;
}

View File

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

View File

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

View File

@ -2,7 +2,7 @@
* @Author: theajack
* @Date: 2021-07-24 23:16:34
* @LastEditor: theajack
* @LastEditTime: 2021-07-25 17:07:04
* @LastEditTime: 2021-07-27 23:36:44
* @Description: Coding something
*/
@ -10,7 +10,7 @@ import {config} from '../config';
import ToStringDetector from './to-string';
import DefineIdDetector from './define-id';
import SizeDetector from './size';
import LogTimeDetector from './log-time';
// import LogTimeDetector from './log-time';
import {clearDDInterval, clearDDTimeout} from '../interval';
const detectorList = [];
@ -20,7 +20,7 @@ export const DETECTOR_TYPE = {
TO_STRING: 0,
DEFINE_ID: 1,
SIZE: 2,
LOG_TIME: 3,
// LOG_TIME: 3,
};
export function registDetector (detector) {
@ -31,7 +31,7 @@ export function initDetectors () {
ToStringDetector();
DefineIdDetector();
SizeDetector();
LogTimeDetector();
// LogTimeDetector();
}
export function triggerOnDevOpen (type = DETECTOR_TYPE.UNKONW) {

View File

@ -2,29 +2,41 @@
* @Author: theajack
* @Date: 2021-07-24 23:15:22
* @LastEditor: theajack
* @LastEditTime: 2021-07-25 16:35:51
* @LastEditTime: 2021-07-26 10:42:58
* @Description: Coding something
*/
import {DETECTOR_TYPE, triggerOnDevOpen} from './detector';
import {registInterval} from '../interval';
// import {DETECTOR_TYPE, triggerOnDevOpen} from './detector';
// import {registInterval} from '../interval';
function logTime () {
const d = new Date();
for (let i = 0; i < 1000; i++) {
console.log(1);
}
console.clear();
if (new Date() - d > 40) {
console.warn(new Date() - d);
triggerOnDevOpen(DETECTOR_TYPE.LOG_TIME);
}
}
// function logTime () {
// const d = new Date();
// for (let i = 0; i < 2000; i++) {
// console.log(1);
// }
// console.clear();
// if (new Date() - d > 100) {
// console.warn(new Date() - d);
// triggerOnDevOpen(DETECTOR_TYPE.LOG_TIME);
// }
// }
export default function detector () {
registInterval((time) => {
if (time % 5 === 0) {
logTime();
}
});
}
// export default function detector () {
// registInterval((time) => {
// if (time % 5 === 0) {
// logTime();
// }
// });
// }
/**
* 2000
* windows
* edge 106 15
* qq 238 11
* chrome 166 39
* ie 211 1
* 360 134 23
* firefox 255 54
*
*/

4
src/index.d.ts vendored
View File

@ -1,5 +1,5 @@
declare type DETECTOR_TYPE = -1 | 0 | 1 | 2 | 3;
declare type DETECTOR_TYPE = -1 | 0 | 1 | 2;
declare interface optionStatic {
md5?: string; // 绕过禁用的md5值详情见3.2,默认不启用绕过禁用
url?: string; // 关闭页面失败时的跳转页面默认值为localhost
@ -18,7 +18,7 @@ declare interface DDTStatic {
TO_STRING: 0;
DEFINE_ID: 1;
SIZE: 2;
LOG_TIME: 3;
// LOG_TIME: 3;
}
version: string;
}

View File

@ -1 +1 @@
export default '0.1.4';
export default '0.1.5';