feat: 0.2.3 - view version.md for details
This commit is contained in:
parent
21d17b2d04
commit
a36c93b064
@ -114,6 +114,7 @@ declare interface optionStatic {
|
|||||||
stopIntervalTime?: number; // 在移动端时取消监视的等待时长
|
stopIntervalTime?: number; // 在移动端时取消监视的等待时长
|
||||||
clearIntervalWhenDevOpenTrigger?: boolean; // 是否在触发之后停止监控 默认为false, 在使用ondevtoolclose时该参数无效
|
clearIntervalWhenDevOpenTrigger?: boolean; // 是否在触发之后停止监控 默认为false, 在使用ondevtoolclose时该参数无效
|
||||||
detactors?: Array<DETECTOR_TYPE>; // 启用的检测器 检测器详情见 3.5 默认为全部,建议使用全部
|
detactors?: Array<DETECTOR_TYPE>; // 启用的检测器 检测器详情见 3.5 默认为全部,建议使用全部
|
||||||
|
clearLog?: boolean; // 是否每次都清除log
|
||||||
}
|
}
|
||||||
|
|
||||||
declare type DETECTOR_TYPE = -1 | 0 | 1 | 2 | 3 | 4 | 5; // 检测器详情见 3.5
|
declare type DETECTOR_TYPE = -1 | 0 | 1 | 2 | 3 | 4 | 5; // 检测器详情见 3.5
|
||||||
|
@ -112,6 +112,7 @@ declare interface optionStatic {
|
|||||||
disableMenu?: boolean; // Whether to disable the right-click menu The default is true
|
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. This parameter is invalid when using ondevtoolclose
|
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
|
detactors?: Array<DETECTOR_TYPE>; // Enabled detectors For details of detectors, see 3.5. The default is all, it is recommended to use all
|
||||||
|
clearLog?: boolean; // Whether to clear the log every time
|
||||||
}
|
}
|
||||||
|
|
||||||
declare type DETECTOR_TYPE = -1 | 0 | 1 | 2 | 3 | 4 | 5; // 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
|
||||||
|
@ -85,3 +85,7 @@
|
|||||||
2. Add isDevToolOpened api
|
2. Add isDevToolOpened api
|
||||||
3. Fix the accidental injury problem of ios mobile chrome
|
3. Fix the accidental injury problem of ios mobile chrome
|
||||||
4. Added a debug page
|
4. Added a debug page
|
||||||
|
|
||||||
|
## 0.2.3
|
||||||
|
1. Opening the sidebar under edge will cause accidental injury, so disable sizeDetector under edge
|
||||||
|
2. Increase the clearLog parameter to control whether the console is required for each situation, the default is true
|
@ -86,3 +86,7 @@
|
|||||||
2. 增加 isDevToolOpened api
|
2. 增加 isDevToolOpened api
|
||||||
3. 修复 ios mobile chrome 的误伤问题
|
3. 修复 ios mobile chrome 的误伤问题
|
||||||
4. 增加了一个debug页面
|
4. 增加了一个debug页面
|
||||||
|
|
||||||
|
## 0.2.3
|
||||||
|
1. edge 下打开侧边栏会误伤,所以禁用edge下的sizeDetector
|
||||||
|
2. 增加clearLog参数,控制是否需要每次情况控制台,默认为true
|
@ -183,7 +183,7 @@ declare type DETECTOR_TYPE = -1 | 0 | 1 | 2 | 3 | 4 | 5;</code></p>
|
|||||||
<script
|
<script
|
||||||
disable-devtool-auto
|
disable-devtool-auto
|
||||||
md5='1aabac6d068eef6a7bad3fdf50a05cc8'
|
md5='1aabac6d068eef6a7bad3fdf50a05cc8'
|
||||||
src='https://cdn.jsdelivr.net/npm/disable-devtool@0.2.2/disable-devtool.min.js#use'
|
src='https://cdn.jsdelivr.net/npm/disable-devtool@0.2.3/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>
|
||||||
|
@ -112,6 +112,7 @@ declare interface optionStatic {
|
|||||||
disableMenu?: boolean; // Whether to disable the right-click menu The default is true
|
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. This parameter is invalid when using ondevtoolclose
|
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
|
detactors?: Array<DETECTOR_TYPE>; // Enabled detectors For details of detectors, see 3.5. The default is all, it is recommended to use all
|
||||||
|
clearLog?: boolean; // Whether to clear the log every time
|
||||||
}
|
}
|
||||||
|
|
||||||
declare type DETECTOR_TYPE = -1 | 0 | 1 | 2 | 3 | 4 | 5; // 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
|
||||||
|
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
npm/index.d.ts
vendored
1
npm/index.d.ts
vendored
@ -11,6 +11,7 @@ declare interface optionStatic {
|
|||||||
stopIntervalTime?: number; // 在移动端时取消监视的等待时长
|
stopIntervalTime?: number; // 在移动端时取消监视的等待时长
|
||||||
clearIntervalWhenDevOpenTrigger?: boolean; // 是否在触发之后停止监控
|
clearIntervalWhenDevOpenTrigger?: boolean; // 是否在触发之后停止监控
|
||||||
detectors: Array<DETECTOR_TYPE>; // 启用的监测器 默认为全部
|
detectors: Array<DETECTOR_TYPE>; // 启用的监测器 默认为全部
|
||||||
|
clearLog?: boolean; // 是否每次都清除log
|
||||||
}
|
}
|
||||||
declare interface DDTStatic {
|
declare interface DDTStatic {
|
||||||
(option?: optionStatic): void;
|
(option?: optionStatic): void;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "disable-devtool",
|
"name": "disable-devtool",
|
||||||
"version": "0.2.2",
|
"version": "0.2.3",
|
||||||
"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.2.2",
|
"version": "0.2.3",
|
||||||
"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",
|
||||||
|
@ -22,6 +22,7 @@ disableDevtool({
|
|||||||
interval: 1000,
|
interval: 1000,
|
||||||
// tkName: 'ddtk',
|
// tkName: 'ddtk',
|
||||||
disableMenu: false,
|
disableMenu: false,
|
||||||
|
clearLog: false,
|
||||||
// url: 'https://www.baidu.com'
|
// url: 'https://www.baidu.com'
|
||||||
// detectors: [disableDevtool.DETECTOR_TYPE.DATE_TO_STRING],
|
// detectors: [disableDevtool.DETECTOR_TYPE.DATE_TO_STRING],
|
||||||
});
|
});
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import {clearDevToolOpenState} from '../utils/open-state';
|
import {clearDevToolOpenState} from '../utils/open-state';
|
||||||
import {isInIframe} from '../utils/util';
|
import {isEdge, isInIframe} from '../utils/util';
|
||||||
import {DETECTOR_TYPE, triggerOnDevOpen} from './detector';
|
import {DETECTOR_TYPE, triggerOnDevOpen} from './detector';
|
||||||
|
|
||||||
function checkWindowSizeUneven () {
|
function checkWindowSizeUneven () {
|
||||||
@ -46,6 +46,10 @@ export default function detector () {
|
|||||||
console.warn('SizeDetector is disabled in IFrame');
|
console.warn('SizeDetector is disabled in IFrame');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (isEdge) {
|
||||||
|
console.warn('SizeDetector is disabled in Edge');
|
||||||
|
return;
|
||||||
|
}
|
||||||
checkWindowSizeUneven();
|
checkWindowSizeUneven();
|
||||||
window.addEventListener('resize', () => {
|
window.addEventListener('resize', () => {
|
||||||
setTimeout(checkWindowSizeUneven, 100);
|
setTimeout(checkWindowSizeUneven, 100);
|
||||||
|
1
src/index.d.ts
vendored
1
src/index.d.ts
vendored
@ -11,6 +11,7 @@ declare interface optionStatic {
|
|||||||
stopIntervalTime?: number; // 在移动端时取消监视的等待时长
|
stopIntervalTime?: number; // 在移动端时取消监视的等待时长
|
||||||
clearIntervalWhenDevOpenTrigger?: boolean; // 是否在触发之后停止监控
|
clearIntervalWhenDevOpenTrigger?: boolean; // 是否在触发之后停止监控
|
||||||
detectors: Array<DETECTOR_TYPE>; // 启用的监测器 默认为全部
|
detectors: Array<DETECTOR_TYPE>; // 启用的监测器 默认为全部
|
||||||
|
clearLog?: boolean; // 是否每次都清除log
|
||||||
}
|
}
|
||||||
declare interface DDTStatic {
|
declare interface DDTStatic {
|
||||||
(option?: optionStatic): void;
|
(option?: optionStatic): void;
|
||||||
|
@ -11,6 +11,7 @@ export const config = {
|
|||||||
stopIntervalTime: 5000, // 在移动端时取消监视的等待时长
|
stopIntervalTime: 5000, // 在移动端时取消监视的等待时长
|
||||||
clearIntervalWhenDevOpenTrigger: false, // 是否在触发之后停止监控
|
clearIntervalWhenDevOpenTrigger: false, // 是否在触发之后停止监控
|
||||||
detectors: 'all',
|
detectors: 'all',
|
||||||
|
clearLog: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
const MultiTypeKeys = ['detectors', 'ondevtoolclose'];
|
const MultiTypeKeys = ['detectors', 'ondevtoolclose'];
|
||||||
|
@ -2,9 +2,10 @@
|
|||||||
* @Author: tackchen
|
* @Author: tackchen
|
||||||
* @Date: 2021-12-24 13:18:23
|
* @Date: 2021-12-24 13:18:23
|
||||||
* @LastEditors: tackchen
|
* @LastEditors: tackchen
|
||||||
* @FilePath: /disable-devtool/src/log.js
|
* @FilePath: /disable-devtool/src/utils/log.js
|
||||||
* @Description: Coding something
|
* @Description: Coding something
|
||||||
*/
|
*/
|
||||||
|
import {config} from './config';
|
||||||
import {isIE} from './util';
|
import {isIE} from './util';
|
||||||
|
|
||||||
const console = window.console || {
|
const console = window.console || {
|
||||||
@ -18,7 +19,12 @@ export const log = (() => {
|
|||||||
return isIE ? ((...args) => {return console.log(...args);}) : console.log;
|
return isIE ? ((...args) => {return console.log(...args);}) : console.log;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
export const clearLog = (() => {
|
const clearLogFunc = (() => {
|
||||||
// ie 不支持缓存使用 log等方法
|
// ie 不支持缓存使用 log等方法
|
||||||
return isIE ? (() => {return console.clear();}) : console.clear;
|
return isIE ? (() => {return console.clear();}) : console.clear;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
export function clearLog () {
|
||||||
|
if (config.clearLog)
|
||||||
|
clearLogFunc();
|
||||||
|
}
|
||||||
|
@ -107,7 +107,9 @@ export const isFirefox = hasUaName('firefox');
|
|||||||
|
|
||||||
export const isMacOs = hasUaName('macintosh');
|
export const isMacOs = hasUaName('macintosh');
|
||||||
|
|
||||||
export const isOldEdge = hasUaName('edge') && !hasUaName('chrome');
|
export const isEdge = hasUaName('edge');
|
||||||
|
|
||||||
|
export const isOldEdge = isEdge && !hasUaName('chrome');
|
||||||
|
|
||||||
export const isIE = isOldEdge || hasUaName('trident') || hasUaName('msie');
|
export const isIE = isOldEdge || hasUaName('trident') || hasUaName('msie');
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
export default '0.2.2';
|
export default '0.2.3';
|
Loading…
x
Reference in New Issue
Block a user