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:
<script type="text/javascript">
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];} ;
</script>
I am not sure if this is the right approach, but here is my code:
document.write(string.replace(/var _0xd6Bh\=\[\".*/g, XXX));
So the idea is to replace the javascript with XXX 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?
If the script tag is in the head, the following code should get you on the right track. If it’s in the body, simply replace
document.headwithdocument.body. You can of course loop over