If browsers decided to remove document.write and friends, then they would obtain a guarantee that running a script after the recursive DOM assembly routine yields the same result as running the script synchronously within it (regardless of what the script might potentially do), and they would be able to optimize the pipeline to allow you to put scripts in head without triggering a performance problem.<p>As far as usage in the wild goes, I&#x27;ve seen document-stream-related functions in rich text editors and comet (old school &quot;websocket polyfills&quot;) codebases, but that was many years ago. I can&#x27;t say for certain why browsers still support those functions.