webapprt/RemoteDebugger.jsm
author pchang <pchang@mozilla.com>
Fri, 19 Dec 2014 13:25:17 +0800
changeset 221203 003d931d33e51d054b63e4d4ff0cffcd0475a200
parent 219266 b16c58046543597ba9b4b6632cbaacf2a32f2814
child 257120 2fcd73fa8a7e713719ae9ce2c04cc6a458d7735a
permissions -rw-r--r--
Bug 1068474 - Limit the selection range based on the boundary of startcaret and endcaret. r=roc

/* 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();
  }
}