I have an extension and an XPCOM object and i'm trying to do
javascript injection into arbitrary web pages.
in the page load example for ovarlay.js, I try injecting a freshly
created SCRIPT block each time a page loads like so:
var eSCRIPT = doc.createElement("SCRIPT");
if (eSCRIPT){
eSCRIPT.setAttribute("LANGUAGE", "javascript");
eSCRIPT.innerHTML = "alert('local script 2 running!');";
doc.body.appendChild(eSCRIPT);
}
and that works ok .. but when I try injecting the same script living
up on my web server... like so:
var eSCRIPT = doc.createElement("SCRIPT");
if (eSCRIPT){
eSCRIPT.setAttribute("LANGUAGE", "javascript");
eSCRIPT.setAttribute("SRC", "http://www.foo.com/javascripts/
myscript.js");
doc.body.appendChild(eSCRIPT);
}
it often silently fails... but *sometimes* works...
other info: the web page i'm injecting into doesn't belong to my
foo.com domain....
Any ideas why this isn't working???
TIA
_______________________________________________
dev-tech-xpcom mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-xpcom