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:
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
Anyone got any ideas?

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?