beyck
Version:
JavaScript Malicious Behavior Detection Plugin
118 lines (79 loc) • 3.61 kB
Markdown
# 🛡️ BeyckJS - Front end malicious behavior detection plugin
We couldn't find a better name to name it, so we named it **[`Beyck`][1]**. It is a front-end security script designed to protect the security of site resources, such as detecting screen recording, pasting and copying, media file downloading and saving, script file injection or tampering, browser security interception, dynamic malicious debugging, etc. If you are a commercial website, we recommend that you try to learn about it. Compared with other libraries, it does not have polling, does not hinder the main thread rendering, occupies less memory, and can intelligently detect the open status of development tools. If you also want to learn, try installing it quickly!
To learn more about **[BeyckJS][1]** , please visit the official **[website][1]** or click here to view the 👉 **[Demo][2]**
### 👩💻Installation command
###
npm i beyck
### 🔗Module Import
###
```javascript
import Beyck from 'beyck'
```
### 🔗Browser reference
###
```html
<script src="https://unpkg.com/beyck/index.js"></script>
<script src="https://cdn.jsdelivr.net/npm/beyck/index.js"></script>
```
### 🏷️Enable protection
###
⚠️ This feature involves many detection items, and it is not recommended to enable it in your production environment. Please ensure that it runs under a valid domain name, otherwise it will be considered malicious behavior.
###
```javascript
Beyck(function(app) {
//Detected debugging, closing the browser or clearing the page
app.defend(true);
//Detected debugging jump to specified link
app.defend('https://xxx.com');
//Real time monitoring and debugging status
app.defend((state)=>{
if(state){
console.log('Detected debugging tool running');
}else{
console.log('Debugging tool has been closed');
}
});
});
```
### 🏷️Customize user keyboard and mouse behavior
###
⚠️Support selective mouse and button event blocking
###
```javascript
Beyck(function(app) {
//Monitor and handle dangerous button events
app.onkeys((e) => {
console.log('Event type', e.type);
//Do you need protection
if (e.defend) {
//Prevent it from continuing to run by rewriting
e.defend = true;
console.log('The event has been prevented', e.type)
}
console.log('The event has been released', e.type)
});
});
```
### 🏷️Page Launch Lifecycle
###
⚠Callback events throughout the entire process of application startup
###
```javascript
Beyck(function(app) {
//Protection program starts running or has completed initialization
app.onentry(function(data) {
console.log('This is a link passing parameter', data)
});
//The application has been loaded completely
app.onready(function(data) {
console.log('This is asynchronous cross domain parameter passing', data)
});
});
```
<h1 align='center' style="margin-bottom: 50px;color:#fff;font-size: 16px;">📑建议反馈</h1>
<p align='center' style="margin-bottom: 50px;color:#fff;font-size: 16px;">
<span style="background: #dcdcdc;padding: 16px;font-weight: 600;border-radius: 10px;color:#333;margin:16px;"><span>site:</span><span>www.beyck.com</span></span>
<span style="background: #dcdcdc;padding: 16px;font-weight: 600;border-radius: 10px;color:#333;margin:16px;"><span>email:</span><span>it@beyck.com</span></span>
</p>
[1]: https://www.beyck.com/ "https://www.beyck.com/"
[2]: https://www.beyck.com/test/index.html "https://www.beyck.com/test/index.html"