How does jq get the browser status and whether it is reduced to the taskbar
I want to make an H5 desktop notification, but I want it to wait until the browser is reduced to the taskbar. If it is in the expanded state, it cannot be triggered.
I don’t know if jq can do it, because I saw the web version of WeChat and smartqq are like this, but I don’t know if js can do it
怪我咯2017-05-19 10:26:55
First determine whether it is in the current window
if(window.document.hidden){
//new Notification
}
PHP中文网2017-05-19 10:26:55
Isn’t it enough to just look at the source code?
http://pub.idqqimg.com/smartq...
The core code is this sentence:
function isDocumentHidden(){
return doc.hidden || doc.mozHidden || doc.webkitHidden;
}