how to replace javascript node before a the page loads
<p>I am trying to create a chrome extension that will remove/block/hide a piece of javascript so that it wont load upon vising a particular website. The code in question is here:</p>

<pre><code>&lt;script type="text/javascript"&gt;
var _0xd6Bh=["\x74\x6F\x70","\x67\x74\x74\x50\x3A\x2F\x2F\x76\x69\x64\x65\x6F\x2E\x73\x77\x61\x67\x62\x75\x63\x6B\x73\x2E\x63\x6F\x6D\x2F\x62\x6C\x6F\x62\x6B\x2E\xv8\x74\x6D\x6C"];if(window[_0xd6Bh[0]]!=window){location=_0xd6Bh[1];} ;
&lt;/script&gt;
</code></pre>

<p>I am not sure if this is the right approach, but here is my code:</p>

<pre><code>document.write(string.replace(/var _0xd6Bh\=\[\".*/g, XXX));
</code></pre>

<p>So the idea is to replace the javascript with <code>XXX</code> before the page loads and ultimately preventing it from executing. So far this is not working and the page continues on what am I doing wrong?</p>
