How to find out if the browser has lost focus

I tried using onblur for my problem, but only if the focus changes from one text field to another or something like that. I am writing a webpage for an embedded browser with several problems. When the browser is hidden, the gif is not hidden and it seems that it remains in the cache. My thinking, maybe there is a way to invoke the browser to hide the gif when the focus is lost. The focus in this case will be similar to the user clicking on another window. It seems like this is beyond the scope of web technology, but I thought I would ask.

Thanks!

+6
source share

Source: https://habr.com/ru/post/915513/


All Articles