CodePudding user response:
Browser basic attributes can be monitored,Through the browser can monitor whether minimize or whether to switch to other page:
Document. The addEventListener (' visibilitychange ', function () {
Var isHidden=document. Hidden;
If (isHidden) {
Alert (" your browser minimizes the, you cheated on ");
}
});
Through add events to the body can monitor to see if there is other software pop-up box, such as QQ pop-up box, youdao dictionary, such as:
<script>
Document. The addEventListener (' visibilitychange ', function () {
Var isHidden=document. Hidden;
If (isHidden) {
Alert (" your browser minimizes the, you cheated on ");
}
});
The function (aa) {
Alert (" do you have other software pop up ");
}
</script>
<body onblur="aa ()" & gt;