4 ms·
I've done this exact same thing to track when people printed vouchers we offered. Have a background image only on the print css.
by ars 8y ago
I've done this exact same thing to track when people printed vouchers we offered. Have a background image only on the print css.
- wybiral 8y agoYeah, I'm playing around with the idea of using the background image trick to profile the integrity hash speed of the visiting browser. That little background image feature in CSS has given up quite a bit of data in similar situations (people used to use it to check browsing history of :visited links before browser started blocking that).
- Domenic_S 8y agoYou're profiling the what now?
- wybiral 8y ago<link> tags to include CSS and JavaScript on a page can have an integrity property, which is a SHA hash of the resource they link to. It's intended to ensure that a CDN doesn't change the content they're serving to your users. But it turns out you can approximate the speed a visiting browser computes those hashes to fingerprint browsers just by including some CSS on a page.
- lucb1e 8y agoBut that hash is a regular, fast hash that takes like 1µs to compute right? Doesn't that get lost in network jitter? Wouldn't averaging the time it takes to run for(i=0;i<Math.pow(2,18);i++); over 10 runs be much more accurate? Or is this meant to spite the 0.01% of visitors that really try not to be tracked and have turned off javascript?
- wybiral 8y ago> But that hash is a regular, fast hash that takes like 1µs to compute right? They use SHA512 which is fast, but noticeable for large enough files. > Or is this meant to spite the 0.01% of visitors that really try not to be tracked and have turned off javascript? Yes, the point is that it works with blockers.
- not2b 8y agoWouldn't the print preview download that image, even if they never print it or convert to a PDF?
- ars 8y agoYes, it would.