I have a .js which I want my Firefox addon to embed into a page.
I've tried the below but it's not working:
Anyone got any ideas?Code:var script = window.content.document.createElement("script"); script.setAttribute("src", "chrome://file.js"); script.setAttribute("type", "text/javascript"); script.onload = function() { // Onload script load events } window.content.document.body.appendChild(script);
Note:
I can't just run the .js "on the addon" so to speak because it includes references like "document.body" which when you write on an addon are "window.content.document.body", etc.
Is there a way around this?


Reply With Quote

Bookmarks