25 ms·
How about browsers rejecting all off-site Javascript loads that don't have subresource integrity hashes, unless they're in iframes? This would force ad network
by Animats 10y ago
How about browsers rejecting all off-site Javascript loads that don't have subresource integrity hashes, unless they're in iframes? This would force ad networks into using iframes. You could still load static assets such as JQuery and fonts from central sites. Anything you needed to load would have to be static. That makes it part of your page, just stored elsewhere. Assets would need versioned URLs. Think of it as version locking for external code.
The requirement for subresource integrity would have to be recursive; if something has an integrity hash, anything it loads must also have an integrity hash. This prevents escaping via indirection.
This would break a lot of sites, of course. (HN would be fine; I just looked at page source.) But it probably wouldn't be much worse than running with Ghostery set to reject all known third party crap. It would definitely break a lot of hostile code.
Not sure if you could enforce this from a browser add-on; those usually don't get control early enough.
- leeoniya 10y agoOne thing I've always found mind-boggling: "HTTPS" When I see HTTPS on a bank's backend/login page, i have the full expectation that what i am entering into the page cannot be seen, screen-scraped or intercepted by any third party. i want full encryption ONLY between me and the domain i see in the address bar. The truth of the matter is, 100 third party scripts (cdns, analytics) can be [and usually are] injected from completely unrelated HTTPS domains, and the average user has absolutely no idea because there is never an indication of this from browser UIs. It is such a blatant violation of trust, and it's the norm! I have no explanation except that advertisers insist on having direct access to the user-agent for tracking/click-through accountability.
- fooey 10y agoForcing ads into iframes would would make responsive websites enough harder that most people wouldn't bother. You'd end up moving all the ads to those obnoxious full screen and intersitionals
- Animats 10y agoThe parent page sets the iframe size; the iframe has to make itself fit. See [1] for a way to do this. If it's too small, the ad should refuse to load and the site doesn't get paid. Amusingly, Google has a canned answer for "iframe size": 200 pixels. [1] http://stackoverflow.com/questions/819416/adjust-width-height-of-iframe-to-fit-with-content-in-it http://stackoverflow.com/questions/819416/adjust-width-heigh...