[{"data":1,"prerenderedAt":625},["ShallowReactive",2],{"project-38413660":3},{"id":4,"name":5,"line":6,"line_source":7,"title":8,"url":9,"domain":10,"maker":11,"posted_at":12,"year":13,"points":14,"comments":15,"rank_in_year":16,"shown_in_year":17,"top":18,"tier":19,"category":20,"subcategory":21,"format":22,"keywords":23,"reception":29,"sentiment":30,"stance_mix":31,"scored_comments":35,"aspects":36,"strip":46,"post_text":48,"what":49,"said":76,"maker_in_thread":197,"shape":199,"grid":203,"attempts":589,"same_week":590,"maker_shows":18,"maker_hidden":618,"reader_version":619,"card":620},"38413660","fun-with-sockets","I saw this mind-blowing experiment, so I made a simple version of it","title","Show HN: I saw this mind-blowing experiment, so I made a simple version of it","https:\u002F\u002Fgithub.com\u002FMomciloo\u002Ffun-with-sockets","github.com","momciloo",1700921809,2023,403,129,77,3109,3,"legend","creative","interactive browser demo","web_app",[24,25,26,27,28],"browser windows","websockets","window position","multi-window","javascript","curious",0,{"positive":32,"neutral":33,"mixed":30,"critical":34},10,28,17,55,{"idea":37,"design":40,"performance":41,"execution":42,"privacy":44,"docs":45},{"positive":38,"critical":39},5,4,{"positive":30,"critical":30},{"positive":30,"critical":30},{"positive":43,"critical":18},1,{"positive":43,"critical":32},{"positive":30,"critical":30},[38,30,18,18,18,30,18,18,18,18,18,18,38,43,43,43,30,30,43,38,43,18,38,18,30,43,38,39,39,43,47,18,18,30,43,43,30,30,38,43],2,"Two browser windows (acting as socket clients) communicate their:\n\n- Screen dimensions - (screen.width, screen.height)\n\n- Window dimensions - (window.innerWidth, window.innerHeight)\n\n- Window X\u002FY position - (window.screenX, window.screenY)\n\n...or whichever calculation works best for you.\n\nThe original work by Bjorn Staal https:\u002F\u002Ftwitter.com\u002F_nonfigurativ_\u002Fstatus\u002F172732259457002734 used localStorage, but I found sockets more fun, because if tweaked a bit, this can be shared with friends.\n\nHere's a demo of how it works and the codebase: https:\u002F\u002Fgithub.com\u002FMomciloo\u002Ffun-with-sockets\u002F",{"problem":50,"audience":56,"pricing":56,"motivation":57,"time_to_build":56,"stack":61,"openness":74,"stage":75,"team_size":75},{"value":51,"source":52,"evidence":53},"Lets browser windows coordinate their positions to create shared visual experiences across screens","maker",[54],{"id":55},"post",null,{"value":58,"source":52,"evidence":59},"Found sockets more fun than localStorage and wanted to share it with friends",[60],{"id":55},[62,70],{"value":63,"source":64,"evidence":65},"JavaScript","inferred",[66],{"id":67,"by":68,"text":69},"38418897","bdcravens","Love how simple the code is, with almost no external dependencies",{"value":71,"source":52,"evidence":72},"WebSockets",[73],{"id":55},"open_source","unknown",{"praise":77,"objections":98,"requests":129,"questions":152,"alternatives":167},[78,94],{"value":79,"source":80,"evidence":81},"Cool demo and fun creative use of browser APIs","commenter",[82,86,90],{"id":83,"by":84,"text":85},"38417806","awei","I love the concept and the demo! Amazing creative work",{"id":87,"by":88,"text":89},"38417341","p-nerd","Really great. The web is really going forward",{"id":91,"by":92,"text":93},"38415408","bionhoward","Wow this seems profound, I didn’t even know you could do that, that could be the future of augmented reality if you think about it, layers! Great job!",{"value":95,"source":80,"evidence":96},"Simple code with almost no dependencies",[97],{"id":67,"by":68,"text":69},[99,118],{"value":100,"source":80,"evidence":101},"Exposing window and screen position to websites is a privacy and fingerprinting risk",[102,106,110,114],{"id":103,"by":104,"text":105},"38431386","account42","None of these screen properties should be available to websites.",{"id":107,"by":108,"text":109},"38415809","munch117","Am I the only one that's horrified that window.screenX and window.screenY exist? This is not information that I want to provide.",{"id":111,"by":112,"text":113},"38415840","no_time","W-why is window LOCATION exposed to websites? Apparently even in FF private browsing... At first I thought this is an electron only thing. I get it that we gave up on…",{"id":115,"by":116,"text":117},"38416560","zer0kool","Sorry, i'm a little lost. I tried thinking about it, but I can't think of any nefarious attacks someone could do with screenX\u002FY. Why is that such a risk? What could they possibly…",{"value":119,"source":80,"evidence":120},"Laggy updates over the network",[121,125],{"id":122,"by":123,"text":124},"38417486","Filligree","But… why does it lag? Shouldn’t this be trivial enough to be instant?",{"id":126,"by":127,"text":128},"38418098","taberiand","Probably because of websocket network lag and also, in my anecdotal experience, window position updates are sometimes strangely jittery",[130,137],{"value":131,"source":80,"evidence":132},"Support for multiple monitors",[133],{"id":134,"by":135,"text":136},"38417315","vunderba","That's a great demo! I'd be curious to see how this would work with multiple monitors. Also, thank you for voluntarily acknowledging that you were directly inspired by somebody…",{"value":138,"source":80,"evidence":139},"Use BroadcastChannel or postMessage instead of a socket for local communication",[140,144,148],{"id":141,"by":142,"text":143},"38415530","rtcode_io","Use BroadcastChannel; you don't need no sockets https:\u002F\u002Fdeveloper.mozilla.org\u002Fen-US\u002Fdocs\u002FWeb\u002FAPI\u002FBroadcast_Channel_API",{"id":145,"by":146,"text":147},"38418685","nikeee","You can use a BroadcastChannel to send messages between the Windows directly. This should reduce latency when working locally.",{"id":149,"by":150,"text":151},"38417588","bawolff","I wonder if it would be more instant if they used postMessage api instead of going over network.",[153,160],{"value":154,"source":80,"evidence":155},"Does it work on Wayland",[156],{"id":157,"by":158,"text":159},"38416176","gmueckl","Does this work on Wayland?",{"value":161,"source":80,"evidence":162},"What is the practical application",[163],{"id":164,"by":165,"text":166},"38416386","butz","I'm wondering about practical application of this demo...",[168,179,190],{"value":169,"source":80,"evidence":170},"Bjorn Staal's original localStorage multi-window demo",[171,175],{"id":172,"by":173,"text":174},"38419895","heavyset_go","> The original work by Bjorn Staal https:\u002F\u002Ftwitter.com\u002F_nonfigurativ_\u002Fstatus\u002F172732259457002734 used localStorage, but I found sockets more fun, because if tweaked a bit, this…",{"id":176,"by":177,"text":178},"38416954","sprobertson","Might as well link to the original \u002F \"stolen from\" author's equivalent demo with Three.js - https:\u002F\u002Fbgstaal.github.io\u002FmultipleWindow3dScene\u002F - and repo -…",{"value":180,"source":80,"evidence":181},"Browser Ball by Google Chrome Experiments",[182,186],{"id":183,"by":184,"text":185},"38419388","unfunco","Browser Ball maybe? https:\u002F\u002Fexperiments.withgoogle.com\u002Fbrowser-ball",{"id":187,"by":188,"text":189},"38423263","Zacru","This and the original reminded me of this really old Chrome Experiments demo, and some others like it: https:\u002F\u002Fexperiments.withgoogle.com\u002Fbrowser-ball",{"value":191,"source":80,"evidence":192},"WindowKill video game",[193],{"id":194,"by":195,"text":196},"38420221","Simran-B","If you like this, you might also enjoy WindowKill, a video game similar to Asteroids that cleverly uses windows that can overlap and interact with each other. You need to shoot…",{"comments":30,"answered":30,"key":198},[],{"commenters":200,"max_depth":38,"maker_replies":30,"first_comment_mins":201,"lifespan_hours":202},109,241,69,[204,206,210,213,216,218,221,224,227,231,234,238,239,241,242,244,247,249,252,254,257,261,264,267,272,276,279,280,284,286,289,292,293,297,300,303,307,310,313,316,320,325,328,329,333,337,342,345,348,350,354,357,360,363,365,368,371,374,377,380,384,388,391,394,397,400,404,406,409,411,415,417,422,426,429,433,437,441,445,448,451,454,456,459,463,466,468,473,476,478,480,483,486,488,491,494,496,499,503,506,508,511,515,518,521,524,527,530,533,534,537,540,543,545,547,549,552,554,557,559,563,566,569,571,573,575,578,582,584,587],[134,30,38,205,135,30],"maker\u002Fpositive\u002Fnone",[207,30,30,208,209,30],"38418203","commenter\u002Fneutral\u002Fnone","stavros",[211,30,30,208,212,30],"38418741","zxexz",[214,30,30,208,215,30],"38419241","kh0st",[217,30,30,208,209,30],"38420349",[219,30,30,208,220,30],"38421620","Sirizarry",[222,30,30,208,223,30],"38422750","bipson",[225,30,30,208,226,30],"38430465","freilanzer",[228,30,18,229,230,30],"38423556","project\u002Fneutral\u002Fidea","tijtij",[232,43,18,229,233,30],"38416214","itronitron",[235,47,30,236,237,30],"38419165","other\u002Fneutral\u002Fnone","aylmao",[183,47,30,236,184,30],[240,47,30,236,237,30],"38419542",[194,18,30,236,195,30],[172,39,18,243,173,30],"project\u002Fneutral\u002Fnone",[245,39,30,236,246,30],"38419950","kpandit",[248,39,30,208,173,30],"38427017",[250,39,30,236,251,30],"38420069","iamateapot",[253,39,30,208,173,30],"38427015",[255,38,30,236,256,30],"38417243","sshh12",[258,259,18,243,260,30],"38417443",6,"Agingcoder",[262,259,18,229,263,30],"38417961","NL807",[265,259,18,229,266,30],"38418410","et-al",[268,269,18,270,271,30],"38415286",7,"project\u002Fneutral\u002Fdesign","doctorhandshake",[273,269,30,274,275,30],"38417002","commenter\u002Fneutral\u002Fdesign","benj111",[122,277,18,278,123,30],8,"project\u002Fneutral\u002Fperformance",[149,277,18,278,150,30],[281,277,30,282,283,30],"38418915","commenter\u002Fneutral\u002Fperformance","4death4",[285,277,30,282,150,30],"38421645",[287,277,30,282,288,30],"38419054","rco8786",[290,277,18,278,291,30],"38419357","crabmusket",[126,277,18,278,127,30],[294,277,18,295,296,30],"38418279","project\u002Fneutral\u002Fexecution","mrits",[298,277,18,295,299,30],"38418319","EGreg",[301,277,18,295,302,30],"38423143","Zecc",[304,277,30,305,306,30],"38418324","commenter\u002Fneutral\u002Fexecution","raincole",[308,277,30,208,309,30],"38418995","trevor-e",[311,277,18,278,312,30],"38419207","akdor1154",[314,277,18,278,315,30],"38419880","Geee",[317,277,30,318,319,30],"38424713","other\u002Fneutral\u002Fperformance","ogurechny",[321,322,38,323,324,30],"38416695",9,"project\u002Fpositive\u002Fidea","ww520",[326,322,30,208,327,30],"38418199","abid786",[145,32,18,278,146,30],[330,32,43,331,332,30],"38429202","project\u002Fcritical\u002Fexecution","staticBr",[334,335,30,236,336,30],"38420374",11,"oniony",[338,339,30,340,341,30],"38416287",12,"other\u002Fneutral\u002Fidea","hot_gril",[103,343,43,344,104,30],13,"project\u002Fcritical\u002Fprivacy",[346,343,43,344,347,30],"38438765","nomel",[349,343,43,344,104,30],"38444538",[351,352,30,236,353,30],"38416156",14,"jocaal",[355,352,30,236,356,30],"38416177","lgats",[358,352,30,208,359,30],"38416496","dylan604",[361,352,30,208,362,30],"38416706","bbarnett",[364,352,30,208,359,30],"38417650",[366,352,30,236,367,30],"38416780","PakG1",[369,352,30,236,370,30],"38417856","38",[372,352,30,236,373,30],"38428116","feross",[375,352,30,236,376,30],"38419152","derangedHorse",[378,352,30,236,379,30],"38419326","CrimsonRain",[381,382,30,340,383,30],"38429114",15,"orobinson",[385,386,43,331,387,30],"38417839",16,"hoosieree",[389,34,30,236,390,30],"38415396","mholt",[392,34,30,236,393,30],"38416235","Kiro",[395,34,38,323,396,30],"38417307","burcs",[398,34,30,236,399,30],"38418101","worldsayshi",[401,402,30,236,403,30],"38419810",18,"jakegmaths",[157,405,18,295,158,30],19,[407,405,43,331,408,30],"38417973","HellsMaddy",[410,405,43,344,104,30],"38431446",[412,413,38,323,414,30],"38420176",20,"arshxyz",[187,416,30,236,188,30],21,[418,419,18,420,421,30],"38419377",22,"project\u002Fneutral\u002Fdocs","EugeneOZ",[423,424,38,205,425,30],"38415719",23,"kaycebasques",[427,424,30,236,428,30],"38417613","system2",[430,431,18,295,432,30],"38415450",24,"aantix",[434,435,30,236,436,30],"38419708",25,"faloppad",[438,439,18,278,440,30],"38424490",26,"dclowd9901",[442,443,30,444,370,30],"38415279",27,"other\u002Fneutral\u002Fdocs",[446,33,30,236,447,30],"38415783","placebo",[449,33,30,236,450,30],"38416254","HatchedLake721",[452,33,30,236,453,30],"38416694","whenlambo",[455,33,30,236,447,30],"38416803",[457,33,43,458,399,30],"38418153","project\u002Fcritical\u002Fidea",[460,461,30,236,462,30],"38415837",29,"adroitboss",[464,461,30,236,465,30],"38417848","throwaway7679",[467,461,30,236,462,30],"38421971",[469,470,38,471,472,30],"38420874",30,"project\u002Fpositive\u002Fprivacy","amelius",[67,474,38,475,68,30],31,"project\u002Fpositive\u002Fexecution",[164,477,18,229,165,30],32,[479,477,18,229,399,30],"38418167",[481,477,18,229,482,30],"38418512","sntran",[484,477,43,344,485,30],"38420160","bartvk",[83,487,38,323,84,30],33,[87,489,38,490,88,30],34,"project\u002Fpositive\u002Fnone",[492,489,43,458,493,30],"38419131","bottled_poe",[111,495,43,344,112,30],35,[497,495,43,344,498,30],"38415980","a_wild_dandan",[500,495,18,501,502,30],"38416053","project\u002Fneutral\u002Fprivacy","crazygringo",[504,495,18,295,505,30],"38417664","thayne",[107,507,43,344,108,30],36,[509,507,18,501,510,30],"38415845","progbits",[512,507,30,513,514,30],"38417293","commenter\u002Fneutral\u002Fprivacy","Cyphase",[516,507,30,513,517,30],"38418867","fyokdrigd",[519,507,30,520,104,30],"38431487","other\u002Fneutral\u002Fprivacy",[522,507,18,295,523,30],"38415863","xeckr",[525,507,30,520,526,30],"38415942","Andrews54757",[528,507,30,236,529,30],"38416116","david_allison",[531,507,30,236,532,30],"38416544","geoelectric",[115,507,30,513,116,30],[535,507,30,520,536,30],"38416850","jackewiehose",[538,507,30,520,539,30],"38417414","spiderice",[541,507,30,520,542,30],"38420299","pixel8account",[544,507,43,344,108,30],"38417011",[546,507,43,344,517,30],"38418899",[141,548,43,458,142,30],37,[550,548,30,208,551,30],"38415724","bigyikes",[176,553,30,236,177,30],38,[555,553,30,236,556,30],"38420727","jdthedisciple",[558,553,30,236,177,30],"38426508",[560,561,30,236,562,30],"38415856",39,"andybak",[564,561,30,236,565,30],"38415890","cpach",[567,561,30,236,568,30],"38415892","zerojames",[570,561,30,236,315,30],"38419912",[572,561,30,236,542,30],"38420306",[91,574,38,323,92,30],40,[576,574,30,208,577,30],"38415470","simbolit",[579,574,30,580,581,30],"38415866","commenter\u002Fcritical\u002Fnone","Takennickname",[583,574,30,340,92,30],"38421028",[585,574,43,458,586,30],"38415673","jonhohle",[588,574,30,208,92,30],"38421035",[],[591,596,601,605,609,614],{"id":592,"name":593,"points":594,"category":595},"38432486","dalle.party",587,"ai",{"id":597,"name":598,"points":599,"category":600},"38434574","Trains.fyi",503,"infrastructure",{"id":602,"name":603,"points":604,"category":595},"38453047","Dobb·E",394,{"id":606,"name":607,"points":608,"category":600},"38409164","IP Guide",363,{"id":610,"name":611,"points":612,"category":613},"38390714","React Spreadsheet 2",356,"dev_tools",{"id":615,"name":616,"points":617,"category":595},"38457815","meta-vision-api",226,false,"v2",{"id":621,"name":5,"line":6,"ai":618,"cat":20,"year":13,"points":14,"comments":15,"rec":29,"s":30,"top":18,"kw":622,"maker":11,"domain":10,"tier":19,"attempts":30,"strip":623,"url":9,"mix":624,"praise":79,"objection":100,"sub":21},38413660,[24,25,26,27,28],"5033303333335111001513530154412330110051",[32,33,30,34],1794036645167]