I have a site I'm loading via iframe and it's on the same server. I need to remove a certain script tag before the page inside the iframe is loaded. In order words, intercept and remove the script before it's executed.
I tried
var x = doc.getElementsByTagName('script');
doc.getElementsByTagName('head').removeChild(x);
But this doesn't seem to be able to catch the script before it executes. What other methods or options exist to achieve this objective?
Thanks