The current page gets and loses focus

Intercept the current page to gain focus and lose focus
<html>
<head>
<script type="text/javascript">
window.onfocus = function(){
console.log('test-in');
};
window.onblur = function (){
console.log('test-out');
};

</script>
</head>
<body>

</body>
</html>

Press F12 to enter the console console to see

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326852574&siteId=291194637
Recommended