Hacker News new | ask | show | jobs
by remedan 935 days ago
To add another data point, it works for on me on Linux/Firefox/X. So the Wayland theory might be correct.
2 comments

Which makes me glad I am using wayland. I am not comfortable with the idea that one browser window could be aware of things like the position of another browser window on my desktop.
The browser doesn’t communicate such things between unrelated clients, say, on different domains. The browser does allow a site to communicate with the popup that it opened, which is what this game is doing, and is not problematic.
Are you aware of the window.screenX property? It does not really seem to have any restriction. Does it?

https://developer.mozilla.org/en-US/docs/Web/API/Window/scre...

Yes, you can access window.screenX for your own window, but not for other windows. If you’re writing code for an iframe embedded into a domain that’s not yours, your code does not have access to the parent’s windows.screenX.
Are you really that worried that firefox is aware of the desktop coordinates of 2 of its own windows?
Firefox knows where all its windows are, of course, but that’s not the potential issue being raised. The problem is allowing untrusted javascript access to that info. Luckily, Firefox doesn’t do that, it only allows you (JavaScript author) window information for the windows you’ve directly opened in code.
Actually I don't think Firefox knows the position of the window in Wayland. I thought that coordinates of windows were considered as a compositor concern and not shared with the client.
Not on Wayland it doesn't. Nor does it know if either window is visible, nor if it has been damaged since the last render.
Better even: the parent window knows the position of it's child window. So firefox only knows the one window. And that in a situation where you actively had to allow the permission for the parent to spawn the child in the first place.

Sounds nothing but reasonable to me.

Same with sway. It also tiles the windows for you, which doesn't help.