Block a single embedded script
Posted: Sun Mar 21, 2010 9:04 pm
Hi I've been testing something on my own webspace.
To prevent any other manipulating of the page content on the client side I could stop events from bubbling up using the stopPropagation function, by embedding this piece of javascript in the page:
This would stop extentions like greasemonkey for example too as they only get fired after the DOM was loaded but at that point stopPropagation prevents it from running.
My question is, can I reverse this and prevent this specific embedded script from running, using the surrogate replacement method?
To prevent any other manipulating of the page content on the client side I could stop events from bubbling up using the stopPropagation function, by embedding this piece of javascript in the page:
Code: Select all
if (document.addEventListener) {
document.addEventListener("DOMContentLoaded", function(ev) {ev.stopPropagation();}, false);
}else if(document.attachEvent){
document.attachEvent("DOMContentLoaded", function(ev) {ev.stopPropagation();});
}else{
document.DOMContentLoaded = function(ev){ev.stopPropagation();};
}
My question is, can I reverse this and prevent this specific embedded script from running, using the surrogate replacement method?