
Web pages can now detect when Chrome’s window is covered by another window - SimeVidas
https://webplatform.news/issues/2019-03-27#web-pages-can-now-detect-when-chrome-s-window-is-covered-by-another-window
======
purple_ducks
Seems like a good time for the various OSes to have a blacklist of programs
who shouldn't be able to access this info - chrome being the first program to
add to list.

------
marssaxman
Once upon a time, I genuinely thought of a browser as a "user-agent", as
hinted in the HTTP header; a tool I could use to reach out into the world.

I have increasingly had to abandon that idea and treat browsers as potentially
hostile incursions into my computer, since browser makers seem determined to
prioritize the needs of web developers by granting them access into my machine
without really bothering to get my consent. Why do I have to use third-party
add-ons that break browser default behaviors in order to get back to a
comfortable security state? This suggests that my interests and those of the
browser makers, especially Google, are not well aligned, and that really
reduces the usefulness of the web for me.

------
tartoran
Yuck. Is this a move to help advertisers pause ads when we switch to a
different tab? Imagine adds not going away until you watch them...

What's the official use case for this?

~~~
pssflops
It is already possible to detect whether the current tab is being viewed or
not (window.onfocus) in javascript.

------
hackersword
Can an extension like tampermonkey block/highjack events from a page?

~~~
sli
Yes. jQuery's `.unbind()` can do it easily, but doing it in vanilla JS is a
bit different[1]. You essentially clone the node and swap the clone into the
original node's spot. This also clears all event handlers for any child nodes
(so, swap out <body> with a clone and you're set).

[1]:
[https://stackoverflow.com/a/19470348/13876](https://stackoverflow.com/a/19470348/13876)

