Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • Your other app's window must not necessarily cover the browser window, they could both still be visible. If the API reported the page as invisible in that state, it would simply be wrong. (And I don't think it should be the job of an in-browser API, to check on whatever else might be going on on my desktop.)
    – CBroe
    Commented Mar 7 at 11:29
  • Possibly the same question, but it's unclear if things have moved on - the jquery solution seems to still work, but this question not tagged jquery and perhaps a bit of overkill to add it just for this: stackoverflow.com/questions/1060008/…
    – fdomn-m
    Commented Mar 7 at 11:31
  • @freedomn-m using angular for the project, so don't want to add jquery over it. Commented Mar 7 at 11:42
  • @CBroe the thing is I want to detect whether browser is now in focus, I guess chrome allows it through its own api, but that would mean I would have to detect it for specific browsers. I wanted to see if there is any single solution for it. Haven't been able to find any till now. Commented Mar 7 at 11:44
  • There are other solutions in that question
    – fdomn-m
    Commented Mar 7 at 11:55