3 ms·
Even without early hints, i assume you could do the same thing with the link http header. Or if you really dont care about performance, just loading the start
by bawolff 3y ago
Even without early hints, i assume you could do the same thing with the link http header.
Or if you really dont care about performance, just loading the start (e.g. <head>) of the document and wait a little bit to see which subresources are loaded.
- eli 3y agoYeah but the critical piece here is loading Early Hints happens before the HTML is sent to the browser. So the server can change the HTML of the page based on what the browser does. (I wonder about the performance impact of this though.) Trying to detect adblock via a <link> (or an <img> or a <script> etc) means you have to do the check in javascript, which can be manipulated by the browser.
- bawolff 3y agoNo, not neccesarily. With the link http header (different from the <link> tag) you just send the http headers, but can still change the response body based on what the browser does. Alternatively, By sending just the start of the document, then pausing, you can change the rest of the document based on what the browser does with the start, since browsers start loading css/js referenced in the document before the main document completes loading. (Before web sockets were a thing, this was basically the technique used for that sort of thing, called "long polling") None of this requires javascript.
- Repulsion9513 3y agoYou can send some content (<link>) and then wait for something else to happen (prefetch) before you continue sending the rest of the content (the page).
- mechazawa 3y agoYep that also works, I've made a proof of concept for that ages ago https://github.com/Mechazawa/pixelAntiAdblock/blob/master/application.py#L42 https://github.com/Mechazawa/pixelAntiAdblock/blob/master/ap...