logoalt Hacker News

sheepttoday at 2:31 AM1 replyview on HN

There's several web APIs for browser window positioning, like screenX/Y[0] (which is what OP uses), which allows for those classic pop-up based browser games from over a decade ago, like Browser Ball.[1]

[0]: demo: https://mdn.github.io/dom-examples/screenleft-screentop/

[1]: https://romanbaiocco.github.io/browser-ball-reloaded/


Replies

seba_dos1today at 3:20 AM

For this to work, the browser itself would have to know where its window is placed on the screen. Not all platforms provide such information.

show 1 reply