|
12 | 12 | const { Cu, Ci, components } = require("chrome");
|
13 | 13 |
|
14 | 14 | // DevTools
|
15 |
| -const { DebuggerServer } = Cu.import("resource://gre/modules/devtools/dbg-server.jsm", {}); |
16 | 15 | const { devtools } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
17 |
| -const protocol = devtools["require"]("devtools/server/protocol"); |
18 |
| -const { method, RetVal, ActorClass, Actor, Arg, types } = protocol; |
| 16 | +const { DebuggerServer } = devtools["require"]("devtools/server/main"); |
19 | 17 | const Events = devtools["require"]("sdk/event/core");
|
20 | 18 | const { makeInfallible } = devtools["require"]("devtools/toolkit/DevToolsUtils.js");
|
21 | 19 | const DevToolsUtils = devtools["require"]("devtools/toolkit/DevToolsUtils");
|
22 | 20 | const { NodeActor } = devtools["require"]("devtools/server/actors/inspector");
|
| 21 | +const protocol = devtools["require"]("devtools/server/protocol"); |
| 22 | +const { method, RetVal, ActorClass, Actor, Arg, types } = protocol; |
| 23 | + |
| 24 | +// Make sure the DebuggerServer.ObjectActorPreviewers is initialized. |
| 25 | +// See also: https://github.com/firebug/firequery/issues/32 |
| 26 | +const { ObjectActor } = devtools["require"]("devtools/server/actors/object"); |
23 | 27 |
|
24 | 28 | // Number of items to preview in objects, arrays, maps, sets, lists,
|
25 | 29 | // collections, etc.
|
@@ -52,7 +56,7 @@ function expectState(expectedState, method) {
|
52 | 56 | ", method: " + method);
|
53 | 57 |
|
54 | 58 | let msg = "Wrong State: Expected '" + expectedState + "', but current " +
|
55 |
| - "state is '" + this.state + "'"; |
| 59 | + "state is '" + this.state + "', method: " + method; |
56 | 60 |
|
57 | 61 | return Promise.reject(new Error(msg));
|
58 | 62 | }
|
@@ -160,7 +164,8 @@ var FireQueryActor = ActorClass(
|
160 | 164 |
|
161 | 165 | this.state = "attached";
|
162 | 166 |
|
163 |
| - // xxxHonza: it's sometimes undefined (e.g. when enabling installed FQ) FIXME |
| 167 | + // It's been sometimes undefined (e.g. when enabling installed FQ) |
| 168 | + // See also: https://github.com/firebug/firequery/issues/32 |
164 | 169 | let Previewers = DebuggerServer.ObjectActorPreviewers;
|
165 | 170 | if (typeof Previewers != "undefined") {
|
166 | 171 | Previewers.Object.unshift(this.onBuildPreview);
|
@@ -196,7 +201,8 @@ var FireQueryActor = ActorClass(
|
196 | 201 | win.removeEventListener("firequery-event", this.onDataModified, true);
|
197 | 202 | }
|
198 | 203 |
|
199 |
| - // Remove previewer listener (web console). |
| 204 | + // It's been sometimes undefined (e.g. when enabling installed FQ) |
| 205 | + // See also: https://github.com/firebug/firequery/issues/32 |
200 | 206 | let Previewers = DebuggerServer.ObjectActorPreviewers;
|
201 | 207 | if (typeof Previewers != "undefined") {
|
202 | 208 | removeItem(Previewers.Object, this.onBuildPreview);
|
|
0 commit comments