2013-09-11 00:59:04 +00:00
|
|
|
/* 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");
|
2015-08-10 12:38:56 +00:00
|
|
|
let { require } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
|
|
|
let { DebuggerServer } = require("devtools/server/main");
|
2013-09-11 00:59:04 +00:00
|
|
|
|
|
|
|
this.RemoteDebugger = {
|
|
|
|
init: function(port) {
|
|
|
|
if (!DebuggerServer.initialized) {
|
|
|
|
DebuggerServer.init();
|
|
|
|
DebuggerServer.addBrowserActors("webapprt:webapp");
|
|
|
|
DebuggerServer.addActors("chrome://webapprt/content/dbg-webapp-actors.js");
|
|
|
|
}
|
2014-12-11 02:55:51 +00:00
|
|
|
let listener = DebuggerServer.createListener();
|
|
|
|
listener.portOrPath = port;
|
|
|
|
listener.open();
|
2013-09-11 00:59:04 +00:00
|
|
|
}
|
|
|
|
}
|