feat: 0.0.6 disable-devtool-auto属性
This commit is contained in:
parent
9729440177
commit
77ab9ba830
@ -114,11 +114,11 @@ disableDevtool对象暴露了 md5 方法,可供开发者加密时使用:
|
|||||||
disableDevtool.md5('xxx');
|
disableDevtool.md5('xxx');
|
||||||
```
|
```
|
||||||
|
|
||||||
### 3.2 script使用属性配置
|
### 3.3 script使用属性配置
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<script
|
<script
|
||||||
id='disable-devtool'
|
disable-devtool-auto
|
||||||
src='https://cdn.jsdelivr.net/npm/disable-devtool/disable-devtool.min.js'
|
src='https://cdn.jsdelivr.net/npm/disable-devtool/disable-devtool.min.js'
|
||||||
md5='xxx'
|
md5='xxx'
|
||||||
url='xxx'
|
url='xxx'
|
||||||
@ -131,11 +131,11 @@ disableDevtool.md5('xxx');
|
|||||||
|
|
||||||
注:
|
注:
|
||||||
|
|
||||||
1. 属性配置时必须要带上 `id='disable-devtool'` 属性
|
1. 如希望自动禁用,属性配置时必须要带上 `disable-devtool-auto` 属性
|
||||||
2. 属性配置都是可选的,字段与3.1中一致,区别是将驼峰形式改成横线分割
|
2. 属性配置都是可选的,字段与3.1中一致,区别是将驼峰形式改成横线分割
|
||||||
3. 该script标签建议放在body最底部
|
3. 该script标签建议放在body最底部
|
||||||
|
|
||||||
### 3.3 script不使用属性配置
|
### 3.4 script不使用属性配置
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<script src='https://cdn.jsdelivr.net/npm/disable-devtool/disable-devtool.min.js'></script>
|
<script src='https://cdn.jsdelivr.net/npm/disable-devtool/disable-devtool.min.js'></script>
|
||||||
|
@ -113,11 +113,11 @@ The disableDevtool object exposes the md5 method, which can be used by developer
|
|||||||
disableDevtool.md5('xxx');
|
disableDevtool.md5('xxx');
|
||||||
```
|
```
|
||||||
|
|
||||||
### 3.2 script uses attribute configuration
|
### 3.3 script uses attribute configuration
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<script
|
<script
|
||||||
id='disable-devtool'
|
disable-devtool-auto
|
||||||
src='https://cdn.jsdelivr.net/npm/disable-devtool/disable-devtool.min.js'
|
src='https://cdn.jsdelivr.net/npm/disable-devtool/disable-devtool.min.js'
|
||||||
md5='xxx'
|
md5='xxx'
|
||||||
url='xxx'
|
url='xxx'
|
||||||
@ -130,11 +130,11 @@ disableDevtool.md5('xxx');
|
|||||||
|
|
||||||
Note:
|
Note:
|
||||||
|
|
||||||
1. You must bring the id='disable-devtool'` attribute when configuring attributes
|
1. If you want to automatically disable,you must bring the `disable-devtool-auto` attribute when configuring attributes
|
||||||
2. Attribute configuration is optional, the fields are the same as in 3.1, the difference is that the hump form is changed to horizontal line division
|
2. Attribute configuration is optional, the fields are the same as in 3.1, the difference is that the hump form is changed to horizontal line division
|
||||||
3. The script tag is recommended to be placed at the bottom of the body
|
3. The script tag is recommended to be placed at the bottom of the body
|
||||||
|
|
||||||
### 3.3 script does not use attribute configuration
|
### 3.4 script does not use attribute configuration
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<script src='https://cdn.jsdelivr.net/npm/disable-devtool/disable-devtool.min.js'></script>
|
<script src='https://cdn.jsdelivr.net/npm/disable-devtool/disable-devtool.min.js'></script>
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<title>Disable Devtool Demo</title>
|
<title>Disable Devtool Demo</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<script id='disable-devtool'
|
<script disable-devtool-auto
|
||||||
md5='d4de605ccb923b7e876b3218a1474653'
|
md5='d4de605ccb923b7e876b3218a1474653'
|
||||||
tk-name='tk'
|
tk-name='tk'
|
||||||
src="../npm/disable-devtool.min.js"></script>
|
src="../npm/disable-devtool.min.js"></script>
|
||||||
|
@ -19,3 +19,14 @@
|
|||||||
3. 兼容ie,disableMenu参数在ie下无效,因为ie下右键会阻塞主进程,且无法监听
|
3. 兼容ie,disableMenu参数在ie下无效,因为ie下右键会阻塞主进程,且无法监听
|
||||||
4. 增加config.stopIntervalTime 表示在移动端时取消监视的等待时长
|
4. 增加config.stopIntervalTime 表示在移动端时取消监视的等待时长
|
||||||
5. 优化判断开发者工具打开的逻辑
|
5. 优化判断开发者工具打开的逻辑
|
||||||
|
|
||||||
|
## 0.0.4
|
||||||
|
1. 修改 webpack 打包配置
|
||||||
|
|
||||||
|
## 0.0.5
|
||||||
|
1. 优化onDevToolOpen事件触发逻辑
|
||||||
|
|
||||||
|
## 0.0.6
|
||||||
|
1. 对于标签属性配置,移除id='disable-devtool' 条件,使用 disable-devtool-auto属性
|
||||||
|
2. 修改readme
|
||||||
|
|
||||||
|
@ -114,11 +114,11 @@ disableDevtool对象暴露了 md5 方法,可供开发者加密时使用:
|
|||||||
disableDevtool.md5('xxx');
|
disableDevtool.md5('xxx');
|
||||||
```
|
```
|
||||||
|
|
||||||
### 3.2 script使用属性配置
|
### 3.3 script使用属性配置
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<script
|
<script
|
||||||
id='disable-devtool'
|
disable-devtool-auto
|
||||||
src='https://cdn.jsdelivr.net/npm/disable-devtool/disable-devtool.min.js'
|
src='https://cdn.jsdelivr.net/npm/disable-devtool/disable-devtool.min.js'
|
||||||
md5='xxx'
|
md5='xxx'
|
||||||
url='xxx'
|
url='xxx'
|
||||||
@ -131,11 +131,11 @@ disableDevtool.md5('xxx');
|
|||||||
|
|
||||||
注:
|
注:
|
||||||
|
|
||||||
1. 属性配置时必须要带上 `id='disable-devtool'` 属性
|
1. 如希望自动禁用,属性配置时必须要带上 `disable-devtool-auto` 属性
|
||||||
2. 属性配置都是可选的,字段与3.1中一致,区别是将驼峰形式改成横线分割
|
2. 属性配置都是可选的,字段与3.1中一致,区别是将驼峰形式改成横线分割
|
||||||
3. 该script标签建议放在body最底部
|
3. 该script标签建议放在body最底部
|
||||||
|
|
||||||
### 3.3 script不使用属性配置
|
### 3.4 script不使用属性配置
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<script src='https://cdn.jsdelivr.net/npm/disable-devtool/disable-devtool.min.js'></script>
|
<script src='https://cdn.jsdelivr.net/npm/disable-devtool/disable-devtool.min.js'></script>
|
||||||
|
@ -113,11 +113,11 @@ The disableDevtool object exposes the md5 method, which can be used by developer
|
|||||||
disableDevtool.md5('xxx');
|
disableDevtool.md5('xxx');
|
||||||
```
|
```
|
||||||
|
|
||||||
### 3.2 script uses attribute configuration
|
### 3.3 script uses attribute configuration
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<script
|
<script
|
||||||
id='disable-devtool'
|
disable-devtool-auto
|
||||||
src='https://cdn.jsdelivr.net/npm/disable-devtool/disable-devtool.min.js'
|
src='https://cdn.jsdelivr.net/npm/disable-devtool/disable-devtool.min.js'
|
||||||
md5='xxx'
|
md5='xxx'
|
||||||
url='xxx'
|
url='xxx'
|
||||||
@ -130,11 +130,11 @@ disableDevtool.md5('xxx');
|
|||||||
|
|
||||||
Note:
|
Note:
|
||||||
|
|
||||||
1. You must bring the id='disable-devtool'` attribute when configuring attributes
|
1. If you want to automatically disable,you must bring the `disable-devtool-auto` attribute when configuring attributes
|
||||||
2. Attribute configuration is optional, the fields are the same as in 3.1, the difference is that the hump form is changed to horizontal line division
|
2. Attribute configuration is optional, the fields are the same as in 3.1, the difference is that the hump form is changed to horizontal line division
|
||||||
3. The script tag is recommended to be placed at the bottom of the body
|
3. The script tag is recommended to be placed at the bottom of the body
|
||||||
|
|
||||||
### 3.3 script does not use attribute configuration
|
### 3.4 script does not use attribute configuration
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<script src='https://cdn.jsdelivr.net/npm/disable-devtool/disable-devtool.min.js'></script>
|
<script src='https://cdn.jsdelivr.net/npm/disable-devtool/disable-devtool.min.js'></script>
|
||||||
|
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
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "disable-devtool",
|
"name": "disable-devtool",
|
||||||
"version": "0.0.5",
|
"version": "0.0.6",
|
||||||
"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",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "disable-devtool",
|
"name": "disable-devtool",
|
||||||
"version": "0.0.5",
|
"version": "0.0.6",
|
||||||
"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",
|
||||||
|
@ -75,7 +75,7 @@ function initDevTool () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function checkScriptUse () {
|
function checkScriptUse () {
|
||||||
let dom = document.getElementById('disable-devtool');
|
let dom = document.querySelector('[disable-devtool-auto]');
|
||||||
if (!dom) {
|
if (!dom) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1 +1 @@
|
|||||||
export default '0.0.5';
|
export default '0.0.6';
|
Loading…
x
Reference in New Issue
Block a user