it doesn't
// have access to Services / Components but the listeners defined here
// are imported by webconsole-utils and used for the webconsole actor.

function ConsoleAPIListener(window, owner, consoleID) {
  this.window = window;
  this.owner = owner;
  this.consoleID = consoleID;
  this.observe = this.observe.bind(this);
}

ConsoleAPIListener.prototype = {
  init: function() {
    setConsoleEventHandler(this.observe);
  },
  destroy: function() {
    setConsoleEventHandler(null);
  },
  observe: function(message) {
    this.owner.onConsoleAPICall(message.wrappedJSObject);
  },
  getCachedMessages: function() {
    return retrieveConsoleEvents();
  },
};

exports.ConsoleAPIListener = ConsoleAPIListener;
PK