I'm triyng to create a Chrome extension that block a script before it is executed.
The script tag is in body tag and not in head.
Is it possible to do so?
in manifest.json I have set content_scripts like this:
"content_scripts": [
{
"run_at": "document_start",
"matches": ["http://website.it/*"],
"js": ["dojob.js"]
}]
And my script is this one:
var cont = 0;
document.addEventListener("DOMNodeInserted", function(event){
if(cont==0){
alert(document.getElementsByTagName("script")[0].src);
document.getElementsByTagName("script")[0].src = "";
cont++;
}
});
But the script still runs...
How cant I make it work?