The lesson from the modern web being, if you give web developers a toolbox, they'll figure out how to build a surveillance system.
And for decades we've been creating more powerful tools (Flash/ActionScript, ActiveX, JavaScript, Wasm, etc).
The answer would seem to be that we should be far more careful what tools we allow to be used.
(Note: Not saying restrict all the web this way, but if one wanted to build parent article's wikipedia-esque info web)
If we allow all those, it's just the modern web again.
I think it's generally useful to look at email here, where only a small subset of html—primarily photos + text—are reliably supported across clients.
No third party connections allowed. As for the originating server, they already know you requested the page, no?
Alternatively/in addition, the user agent can treat embedded assets like textbooks do, and present them all as numbered, boxed, and captioned figures.
What would that constraint look like? Is animation and interaction prohibited there, for example?