feat: 0.0.2

This commit is contained in:
theajack 2020-10-22 01:13:53 +08:00
parent 79f118015e
commit fcf9b71fe6
6 changed files with 35 additions and 7 deletions

View File

@ -58,8 +58,13 @@
href="https://theajack.gitee.io/disable-devtool">online trial/document</a> | <a href="https://theajack.gitee.io/disable-devtool">online trial/document</a> | <a
href="https://gitee.com/theajack/disable-devtool">Gitee</a></strong></p> href="https://gitee.com/theajack/disable-devtool">Gitee</a></strong></p>
<p>
Now that the devtool on this page has been disabled, use the <a href='https://theajack.gitee.io/disable-devtool?ddtk=dd'>?ddtk=dd</a> url parameter to un-disable (ddtk value is configurable)
</p>
<h2>1. Quick use</h2> <h2>1. Quick use</h2>
<h3>1.1 npm reference</h3> <h3>1.1 npm reference</h3>
<p><code>npm i disable-devtool</code></p> <p><code>npm i disable-devtool</code></p>
@ -128,6 +133,13 @@ disableDevtool(options);</code></p>
<p><code>disableDevtool.md5(&#39;xxx&#39;);</code></p> <p><code>disableDevtool.md5(&#39;xxx&#39;);</code></p>
<div>
TOOL:
<input type="text" id='md5_key' placeholder="Enter a key">
<button onclick="generateMd5()">Generate md5</button>
<span id='md5_value'></span>
</div>
<h3>3.2 script uses attribute configuration</h3> <h3>3.2 script uses attribute configuration</h3>
<p><code>&lt;script <p><code>&lt;script
@ -156,7 +168,22 @@ disableDevtool(options);</code></p>
// The parameters are the same as in 3.1 // The parameters are the same as in 3.1
}) })
&lt;/script&gt;</code></p> &lt;/script&gt;</code></p>
<script id='disable-devtool' src='https://cdn.jsdelivr.net/npm/disable-devtool/disable-devtool.min.js'></script> <script id='disable-devtool' md5='1aabac6d068eef6a7bad3fdf50a05cc8' src='https://cdn.jsdelivr.net/npm/disable-devtool/disable-devtool.min.js'></script>
<!-- <script id='disable-devtool' md5='1aabac6d068eef6a7bad3fdf50a05cc8' src='./npm/disable-devtool.min.js'></script> -->
<script>
function generateMd5(){
if(!window.DisableDevtool){
alert('DisableDevtool not ready');
return;
}
let key = document.getElementById('md5_key').value;
if(!key){
alert('Key is empty');
return;
}
document.getElementById('md5_value').innerText = DisableDevtool.md5(key);
}
</script>
</body> </body>
</html> </html>

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{ {
"name": "disable-devtool", "name": "disable-devtool",
"version": "0.0.1", "version": "0.0.2",
"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": {

View File

@ -7,10 +7,10 @@
<title>Disable Devtool Demo</title> <title>Disable Devtool Demo</title>
</head> </head>
<body> <body>
<!-- <script src="./bundle.js"></script> --> <script src="./bundle.js"></script>
<script id='disable-devtool' <!-- <script id='disable-devtool'
md5='d4de605ccb923b7e876b3218a1474653' md5='d4de605ccb923b7e876b3218a1474653'
tk-name='tk' tk-name='tk'
src="../npm/disable-devtool.min.js"></script> src="../npm/disable-devtool.min.js"></script> -->
</body> </body>
</html> </html>

View File

@ -1,4 +1,5 @@
import disableDevtool from '../src'; import disableDevtool from '../src';
// import disableDevtool from '../npm';
disableDevtool({ disableDevtool({
md5: 'd4de605ccb923b7e876b3218a1474653', md5: 'd4de605ccb923b7e876b3218a1474653',

View File

@ -9,7 +9,7 @@ module.exports = {
filename: 'disable-devtool.min.js', filename: 'disable-devtool.min.js',
library: 'DisableDevtool', library: 'DisableDevtool',
libraryTarget: 'umd', libraryTarget: 'umd',
umdNamedDefine: true, umdNamedDefine: true, // 这个地方暂时有问题 打包出来的时 {default: DisableDevtool} 临时解决是直接修改打包后的文件
globalObject: 'this' globalObject: 'this'
}, },
module: { module: {