You can create a frame inside the hidden window:
var hiddenWindow = Components.classes["@mozilla.org/appshell/appShellService;1"]
.getService(Components.interfaces.nsIAppShellService)
.hiddenDOMWindow;
var frame = hiddenWindow.document.getElementById("myExtensionFrame");
if (!frame)
{
var XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
frame = hiddenWindow.document.createElementNS(XUL_NS, "iframe");
frame.setAttribute("id", "myExtensionFrame");
frame.setAttribute("src", "...");
hiddenWindow.document.documentElement.appendChild(frame);
}
However, if all you need is a place to run your global code then there are better ways - like JavaScript code modules.