function FrameWorker(url, name) {
  this.url = url;
  this.name = name || url;
  this.ports = {};
  this.pendingPorts = [];
  this.loaded = false;

  this.frame = makeHiddenFrame();

  var self = this;
  Services.obs.addObserver(function injectController(doc, topic, data) {
    if (!doc.defaultView || doc.defaultView != self.frame.contentWindow) {
      return;
    }
    Services.obs.removeObserver(injectController, "document-element-inserted", false);
    try {
      self.createSandbox();
    } catch (e) {
      Cu.reportError("FrameWorker: failed to create sandbox for " + url + ". " + e);
    }
  }, "document-element-inserted", false);

  this.frame.setAttribute("src", url);
}
/**
 * FrameWorker
 *
 * A FrameWorker is an iframe that is attached to the hiddenWindow,
 * which contains a pair of MessagePorts.  It is constructed with the
 * URL of some JavaScript that will be run in the context of the window;
 * the script does not have a full DOM but is instead run in a sandbox
 * that has a select set of methods cloned from the URL's domain.
 */
FrameWorker
A FrameWorker is an iframe that is attached to the hiddenWindow,
which contains a pair of MessagePorts.  It is constructed with the
URL of some JavaScript that will be run in the context of the window;
the script does not have a full DOM but is instead run in a sandbox
that has a select set of methods cloned from the URL's domain.
FrameWorker A FrameWorker is an iframe that is attached to the hiddenWindow which contains a pair of MessagePorts . It is constructed with the URL of some JavaScript that will be run in the context of the window ; the script does not have a full DOM but is instead run in a sandbox that has a select set of methods cloned from the URL ' s domain .
function FrameWorker(url, name) {
  this.url = url;
  this.name = name || url;
  this.ports = {};
  this.pendingPorts = [];
  this.loaded = false;
  this.frame = makeHiddenFrame();
  var self = this;
  Services.obs.addObserver(function injectController(doc, topic, data) {
    if (!doc.defaultView || doc.defaultView != self.frame.contentWindow) {
      return;
    }
    Services.obs.removeObserver(injectController, "document-element-inserted", false);
    try {
      self.createSandbox();
    } catch (e) {
      Cu.reportError("FrameWorker: failed to create sandbox for " + url + ". " + e);
    }
  }, "document-element-inserted", false);
  this.frame.setAttribute("src", url);
}
function FrameWorker ( url , name ) { this . url = url ; this . name = name || url ; this . ports = { } ; this . pendingPorts = [ ] ; this . loaded = false ; this . frame = makeHiddenFrame ( ) ; var self = this ; Services . obs . addObserver ( function injectController ( doc , topic , data ) { if ( ! doc . defaultView || doc . defaultView != self . frame . contentWindow ) { return ; } Services . obs . removeObserver ( injectController , "document-element-inserted" , false ) ; try { self . createSandbox ( ) ; } catch ( e ) { Cu . reportError ( "FrameWorker: failed to create sandbox for " + url + ". " + e ) ; } } , "document-element-inserted" , false ) ; this . frame . setAttribute ( "src" , url ) ; }
FrameWorker
 A FrameWorker is an iframe that is attached to the hiddenWindow,
 which contains a pair of MessagePorts.
FrameWorker A FrameWorker is an iframe that is attached to the hiddenWindow which contains a pair of MessagePorts .