Lurker News
Two browser windows (acting as socket clients) communicate their:

- Screen dimensions - (screen.width, screen.height)
- Window dimensions - (window.innerWidth, window.innerHeight)
- Window X/Y position - (window.screenX, window.screenY)
...or whichever calculation works best for you.
The original work by Bjorn Staal https://twitter.com/_nonfigurativ_/status/172732259457002734 used localStorage, but I found sockets more fun, because if tweaked a bit, this can be shared with friends.
Here's a demo of how it works and the codebase: https://github.com/Momciloo/fun-with-sockets/

Comments (129) 42 threads

Earlier comments
butz3 replies#
I'm wondering about practical application of this demo...
worldsayshi#
Maybe making colour mixing ven diagrams?
sntran#
I have always been fascinated by those sci-fi movies in which a person would swipe up on their tablet, and the current window would fly to another monitor.

This maybe be something that can achieve that.

bartvk#
It would not surprise me if the original practical application is long gone, but it's now used to fingerprint browsers for ad serving purposes.
awei#
I love the concept and the demo! Amazing creative work
p-nerd1 reply#
Really great. The web is really going forward
bottled_poe#
Seems like this was all possible 10+ years ago with existing APIs at that time. I don’t see what’s so special tbh.

Load more comments