This is not possible because HTML requires that scripts be executed during parsing or not executed at all, for example. It is allowed:
<script> document.write('<!'+'--'); </script>
If the browser does not pass this script without executing it, it will see a completely different document, so you will not be able to parse the DOM of the HTML document before running the scripts.
Opera solves this problem in UserJS by BeforeScript events, allowing UserJS to modify / delete scripts at the very last moment.
source share