webapprt/RemoteDebugger.jsm
author Carsten "Tomcat" Book <cbook@mozilla.com>
Mon, 08 Jun 2015 09:36:10 +0200
changeset 278417 2100ac6168480c83433aabe56fb02841966466d0
parent 244956 b16c58046543597ba9b4b6632cbaacf2a32f2814
child 289679 2fcd73fa8a7e713719ae9ce2c04cc6a458d7735a
permissions -rw-r--r--
Backed out changeset 8aaa0a247a6f (bug 1170093) for bustage

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

"use strict";

this.EXPORTED_SYMBOLS = ["RemoteDebugger"];

let Cc = Components.classes;
let Ci = Components.interfaces;
let Cu = Components.utils;

Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import('resource://gre/modules/devtools/dbg-server.jsm');

this.RemoteDebugger = {
  init: function(port) {
    if (!DebuggerServer.initialized) {
      DebuggerServer.init();
      DebuggerServer.addBrowserActors("webapprt:webapp");
      DebuggerServer.addActors("chrome://webapprt/content/dbg-webapp-actors.js");
    }
    let listener = DebuggerServer.createListener();
    listener.portOrPath = port;
    listener.open();
  }
}