feat: 0.1.5
This commit is contained in:
parent
8c888fe71d
commit
2d986cf12a
@ -171,7 +171,6 @@ const DETECTOR_TYPE = {
|
|||||||
TO_STRING: 0,
|
TO_STRING: 0,
|
||||||
DEFINE_ID: 1,
|
DEFINE_ID: 1,
|
||||||
SIZE: 2,
|
SIZE: 2,
|
||||||
LOG_TIME: 3,
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -170,7 +170,6 @@ const DETECTOR_TYPE = {
|
|||||||
TO_STRING: 0,
|
TO_STRING: 0,
|
||||||
DEFINE_ID: 1,
|
DEFINE_ID: 1,
|
||||||
SIZE: 2,
|
SIZE: 2,
|
||||||
LOG_TIME: 3,
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -50,4 +50,8 @@
|
|||||||
1. 增加 detector,增加多种监测模式
|
1. 增加 detector,增加多种监测模式
|
||||||
2. 使用logTime模式兜底,兼容mac,linux
|
2. 使用logTime模式兜底,兼容mac,linux
|
||||||
3. 增加 clearIntervalWhenDevOpenTrigger 参数
|
3. 增加 clearIntervalWhenDevOpenTrigger 参数
|
||||||
4. ondevtoolopen 增加 监测模式 回调参数
|
4. ondevtoolopen 增加 监测模式 回调参数
|
||||||
|
|
||||||
|
## 0.1.5
|
||||||
|
|
||||||
|
1. 去掉log-time监测类型(因为不准确)
|
@ -181,7 +181,7 @@ declare type DETECTOR_TYPE = -1 | 0 | 1 | 2 | 3;</code></p>
|
|||||||
<script
|
<script
|
||||||
disable-devtool-auto
|
disable-devtool-auto
|
||||||
md5='1aabac6d068eef6a7bad3fdf50a05cc8'
|
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>
|
||||||
<!-- <script disable-devtool-auto md5='1aabac6d068eef6a7bad3fdf50a05cc8' src='./npm/disable-devtool.min.js'></script> -->
|
<!-- <script disable-devtool-auto md5='1aabac6d068eef6a7bad3fdf50a05cc8' src='./npm/disable-devtool.min.js'></script> -->
|
||||||
<script>
|
<script>
|
||||||
|
@ -171,7 +171,6 @@ const DETECTOR_TYPE = {
|
|||||||
TO_STRING: 0,
|
TO_STRING: 0,
|
||||||
DEFINE_ID: 1,
|
DEFINE_ID: 1,
|
||||||
SIZE: 2,
|
SIZE: 2,
|
||||||
LOG_TIME: 3,
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -170,7 +170,6 @@ const DETECTOR_TYPE = {
|
|||||||
TO_STRING: 0,
|
TO_STRING: 0,
|
||||||
DEFINE_ID: 1,
|
DEFINE_ID: 1,
|
||||||
SIZE: 2,
|
SIZE: 2,
|
||||||
LOG_TIME: 3,
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
2
npm/disable-devtool.min.js
vendored
2
npm/disable-devtool.min.js
vendored
File diff suppressed because one or more lines are too long
4
npm/index.d.ts
vendored
4
npm/index.d.ts
vendored
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
declare type DETECTOR_TYPE = -1 | 0 | 1 | 2 | 3;
|
declare type DETECTOR_TYPE = -1 | 0 | 1 | 2;
|
||||||
declare interface optionStatic {
|
declare interface optionStatic {
|
||||||
md5?: string; // 绕过禁用的md5值,详情见3.2,默认不启用绕过禁用
|
md5?: string; // 绕过禁用的md5值,详情见3.2,默认不启用绕过禁用
|
||||||
url?: string; // 关闭页面失败时的跳转页面,默认值为localhost
|
url?: string; // 关闭页面失败时的跳转页面,默认值为localhost
|
||||||
@ -18,7 +18,7 @@ declare interface DDTStatic {
|
|||||||
TO_STRING: 0;
|
TO_STRING: 0;
|
||||||
DEFINE_ID: 1;
|
DEFINE_ID: 1;
|
||||||
SIZE: 2;
|
SIZE: 2;
|
||||||
LOG_TIME: 3;
|
// LOG_TIME: 3;
|
||||||
}
|
}
|
||||||
version: string;
|
version: string;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "disable-devtool",
|
"name": "disable-devtool",
|
||||||
"version": "0.1.4",
|
"version": "0.1.5",
|
||||||
"description": "Disable web developer tools from the f12 button, right-click and browser ",
|
"description": "Disable web developer tools from the f12 button, right-click and browser ",
|
||||||
"main": "disable-devtool.min.js",
|
"main": "disable-devtool.min.js",
|
||||||
"unpkg": "disable-devtool.min.js",
|
"unpkg": "disable-devtool.min.js",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "disable-devtool",
|
"name": "disable-devtool",
|
||||||
"version": "0.1.4",
|
"version": "0.1.5",
|
||||||
"description": "Disable web developer tools from the f12 button, right-click and browser ",
|
"description": "Disable web developer tools from the f12 button, right-click and browser ",
|
||||||
"main": "disable-devtool.min.js",
|
"main": "disable-devtool.min.js",
|
||||||
"unpkg": "disable-devtool.min.js",
|
"unpkg": "disable-devtool.min.js",
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* @Author: theajack
|
* @Author: theajack
|
||||||
* @Date: 2021-07-24 23:16:34
|
* @Date: 2021-07-24 23:16:34
|
||||||
* @LastEditor: theajack
|
* @LastEditor: theajack
|
||||||
* @LastEditTime: 2021-07-25 17:07:04
|
* @LastEditTime: 2021-07-27 23:36:44
|
||||||
* @Description: Coding something
|
* @Description: Coding something
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -10,7 +10,7 @@ import {config} from '../config';
|
|||||||
import ToStringDetector from './to-string';
|
import ToStringDetector from './to-string';
|
||||||
import DefineIdDetector from './define-id';
|
import DefineIdDetector from './define-id';
|
||||||
import SizeDetector from './size';
|
import SizeDetector from './size';
|
||||||
import LogTimeDetector from './log-time';
|
// import LogTimeDetector from './log-time';
|
||||||
import {clearDDInterval, clearDDTimeout} from '../interval';
|
import {clearDDInterval, clearDDTimeout} from '../interval';
|
||||||
|
|
||||||
const detectorList = [];
|
const detectorList = [];
|
||||||
@ -20,7 +20,7 @@ export const DETECTOR_TYPE = {
|
|||||||
TO_STRING: 0,
|
TO_STRING: 0,
|
||||||
DEFINE_ID: 1,
|
DEFINE_ID: 1,
|
||||||
SIZE: 2,
|
SIZE: 2,
|
||||||
LOG_TIME: 3,
|
// LOG_TIME: 3,
|
||||||
};
|
};
|
||||||
|
|
||||||
export function registDetector (detector) {
|
export function registDetector (detector) {
|
||||||
@ -31,7 +31,7 @@ export function initDetectors () {
|
|||||||
ToStringDetector();
|
ToStringDetector();
|
||||||
DefineIdDetector();
|
DefineIdDetector();
|
||||||
SizeDetector();
|
SizeDetector();
|
||||||
LogTimeDetector();
|
// LogTimeDetector();
|
||||||
}
|
}
|
||||||
|
|
||||||
export function triggerOnDevOpen (type = DETECTOR_TYPE.UNKONW) {
|
export function triggerOnDevOpen (type = DETECTOR_TYPE.UNKONW) {
|
||||||
|
@ -2,29 +2,41 @@
|
|||||||
* @Author: theajack
|
* @Author: theajack
|
||||||
* @Date: 2021-07-24 23:15:22
|
* @Date: 2021-07-24 23:15:22
|
||||||
* @LastEditor: theajack
|
* @LastEditor: theajack
|
||||||
* @LastEditTime: 2021-07-25 16:35:51
|
* @LastEditTime: 2021-07-26 10:42:58
|
||||||
* @Description: Coding something
|
* @Description: Coding something
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {DETECTOR_TYPE, triggerOnDevOpen} from './detector';
|
// import {DETECTOR_TYPE, triggerOnDevOpen} from './detector';
|
||||||
import {registInterval} from '../interval';
|
// import {registInterval} from '../interval';
|
||||||
|
|
||||||
function logTime () {
|
// function logTime () {
|
||||||
const d = new Date();
|
// const d = new Date();
|
||||||
for (let i = 0; i < 1000; i++) {
|
// for (let i = 0; i < 2000; i++) {
|
||||||
console.log(1);
|
// console.log(1);
|
||||||
}
|
// }
|
||||||
console.clear();
|
// console.clear();
|
||||||
if (new Date() - d > 40) {
|
// if (new Date() - d > 100) {
|
||||||
console.warn(new Date() - d);
|
// console.warn(new Date() - d);
|
||||||
triggerOnDevOpen(DETECTOR_TYPE.LOG_TIME);
|
// triggerOnDevOpen(DETECTOR_TYPE.LOG_TIME);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
export default function detector () {
|
// export default function detector () {
|
||||||
registInterval((time) => {
|
// registInterval((time) => {
|
||||||
if (time % 5 === 0) {
|
// if (time % 5 === 0) {
|
||||||
logTime();
|
// 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
4
src/index.d.ts
vendored
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
declare type DETECTOR_TYPE = -1 | 0 | 1 | 2 | 3;
|
declare type DETECTOR_TYPE = -1 | 0 | 1 | 2;
|
||||||
declare interface optionStatic {
|
declare interface optionStatic {
|
||||||
md5?: string; // 绕过禁用的md5值,详情见3.2,默认不启用绕过禁用
|
md5?: string; // 绕过禁用的md5值,详情见3.2,默认不启用绕过禁用
|
||||||
url?: string; // 关闭页面失败时的跳转页面,默认值为localhost
|
url?: string; // 关闭页面失败时的跳转页面,默认值为localhost
|
||||||
@ -18,7 +18,7 @@ declare interface DDTStatic {
|
|||||||
TO_STRING: 0;
|
TO_STRING: 0;
|
||||||
DEFINE_ID: 1;
|
DEFINE_ID: 1;
|
||||||
SIZE: 2;
|
SIZE: 2;
|
||||||
LOG_TIME: 3;
|
// LOG_TIME: 3;
|
||||||
}
|
}
|
||||||
version: string;
|
version: string;
|
||||||
}
|
}
|
||||||
|
@ -1 +1 @@
|
|||||||
export default '0.1.4';
|
export default '0.1.5';
|
Loading…
x
Reference in New Issue
Block a user