That's why GP wrote MITM, not just network blocking. MITM implies the middlebox is trusted by the browser in which it has installed a certificate, so can see and modify content.
Hm, you mean basically to edit all HTML, CSS etc. just in time? This seems significantly harder (concepts spread over files being loaded in parallel or being partially cached etc) than to do it in the browser once everything is loaded.