javascript stream wrapper, intercept JS file contents
<p>In PHP there's a function called <strong>stream_wrapper_register</strong>. With that i can get the file contents of every PHP file that is about to be included. So that basically gives me control over the 'code' that will get parsed.</p>

<p>I was wondering if there's something like this in javascript too? So suppose i include my file:</p>

<pre><code>&lt;script type="text/javascript" src="js/myfile.js"&gt;&lt;/script&gt;
</code></pre>

<p>My code in that file then sets up the stream wrapper (suppose this is available in JS too). Now i want to be able to get the file contents of every other javascript file that will be included:</p>

<pre><code>&lt;script type="text/javascript" src="js/somefile.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="js/someotherfile.js"&gt;&lt;/script&gt;
</code></pre>

<p>But this ofcourse must happen before before the browser actually executes those files.</p>

<p>So is there a way to intercept that somehow?</p>
