D
D
dollar2019-05-04 02:07:33
JavaScript
dollar, 2019-05-04 02:07:33

How to determine if the browser window has lost focus?

The tab remains the same, the browser window is not minimized. We simply open the calculator app or simply switch to any other application on the system, such as a text editor or another browser.
document.visibilityState will be visible in this case

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
profesor08, 2019-05-04
@dollar

window.addEventListener("blur", () => {console.log(111)})

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question