11 ms·
I first realized Javascript/Frontend/client developers were a danger to society about 10 years ago. We were trying to figure out why some particular, quite glo
by mwfj 9y ago
I first realized Javascript/Frontend/client developers were a danger to society about 10 years ago.
We were trying to figure out why some particular, quite globally popular web site did not work when transcoded in our Opera Mini transcoder.
The page itself looked perfectly static, no fancy effects or anything. Turns out the site had decided to re-implement the "click a link" feature entirely in javascript, down to the "create a click listener for entire document, then create a click router based on X, Y, width, height coordinates" level. We patched it somehow, had a laugh about the stupidity, but the sour feeling of insanity got stuck with me. It did not provide any feature beyond what a simple 'a' tag would have done.
It was just so absurd. We spent some time to try to figure out if there was a legitimate reason for it but we couldn't find any.
- gerdesj 9y agoSounds like a rehash of this: https://www.w3schools.com/tags/tag_map.asp https://www.w3schools.com/tags/tag_map.asp in JS, perhaps designed by someone unable to construct an adequate search engine query to solve the problem they thought they had but having access to a manual for JS. Compound that with the religious zeal that invariably (well - quite often) follows initiation into the sect around a newly discovered programming language. The manual may not actually exist but consist of a few links to Stackoverflow. "Never attribute to malice that ..." as Mr Halon might say. I've found out later that I've re-invented the wheel with a system more than once (mine obviously sported Fandango tyres) and laughed at several other single axis rotation optimised load bearing solution implementations with minimised frictional components and thrust load resistance. Experience is a wonderful thing - your's and theirs (and mine) Cheers Jon
- draw_down 9y agoWell, my problem is you think that's JavaScript's fault.
- talmand 9y agoI believe the blame was aimed at javascript developers, not the language.
- pavement 9y agoWhat you've described is basically a heat map data collection script, or part of one. The script will capture the (x,y) coordinates and cache a running log of where events occurred. It's proxying the events and then forwarding them, so it can get inbetween the event and the outcome, and record the event's details with greater precision. Since JavaScript events are asynchronous, one part of the heatmap recorder may have been decoupled and not directly connected to the rest of its sibling scripts in a very obvious way. But anyway, to get to the point, these heatmap apparatuses do spew useless data, user by user, and can hog system resources in non-obvious ways, but in aggregate, across thousands or millions of users, develop a picture of how many users clicked directly on a button, in proximity to a button, and which button, out of a selection of buttons, was clicked in whichever order. After deploying something like this, the raw (x,y) coordinate data is then collected, and used to generate an image. The image consists of they watthe webpage appeared to the user, and then a semi-transparent false-color overlay is placed as a layer over the appearance of the web page, and the (x,y) coordinates color the pixels red/hot for many clicks, and blue/cold for fewer clicks, like a topographical map. See the results of similar scripts here: https://duckduckgo.com?q=!googleimages+web+page+click+heatmap https://duckduckgo.com?q=!googleimages+web+page+click+heatma... Similar heatmaps are generated in more controlled environments, with eye motion tracking tests, where the user consents to sit in a room, in front of a computer, with a camera attached, and use a redesigned website or app, while the system records the specifics of their behavior, capturing not only clicks, but where they were looking, and how their eyes moved toward the elements that received clicks. Testing processes like these can be really expensive to perform. This is usually done to gather evidence of an effective design layout, among competing designs in an A/B test. If you only noticed part of the script that proxies the click events, it may be that someone left part of an A/B test harness behind, by mistake, or that part of the harness was left out by mistake. These sorts of scripts definitely take the collected click coordinates, and forward them to the server, otherwise it's not possible to assemble the individual events into a heatmap.
- johansch 9y agoHi, thanks for the description. I'm pretty sure that what we witnessed at that time wasn't something like this though. We spent quite some time picking apart the javascript.
- pavement 9y agoWhat you've described is basically a heat map data collection script, or part of one. The script will capture the (x,y) coordinates and cache a running log of where events occurred. It's proxying the events and then forwarding them, so it can get inbetween the event and the outcome, and record the event's details with greater precision. Since JavaScript events are asynchronous, one part of the heatmap recorder may have been decoupled and not directly connected to the rest of its sibling scripts in a very obvious way. But anyway, to get to the point, these heatmap apparatuses spew useless data, user by user, but in aggregate, across thousands or millions of users, develop a picture of how many users clicked directly on a button, in proximity to a button, and which, button out of a selection of buttons was clicked in whichever order. After deploying something like this, the raw (x,y) coordinate data is then collected, and used to generate an image. The image consists of they watthe webpage appeared to the user, and then a semi-transparent false-color overlay is placed as a layer over the appearance of the web page, and the (x,y) coordinates color the pixels red/hot for many clicks, and blue/cold for fewer clicks, like a topographical map. See the results of similar scripts here: https://duckduckgo.com?q=!googleimages+web+page+click+heatmap https://duckduckgo.com?q=!googleimages+web+page+click+heatma... This is usually done to gather evidence of an effective design layout, among competing designs in an A/B test. If you only noticed part of the script that proxies the click events, it may be that someone left part of an A/B test harness behind, by mistake, or that part of the harness was left out by mistake. These sorts of scripts definitely take the collected click coordinates, and forward them to the server, otherwise it's not possible to assemble the individual events into a heatmap.