NoBugs
NoBugs

Reputation: 9512

Addon SDK error getting devtools module

I'm adding this code to a Addon-SDK addon:

var {devtools} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
var {WebConsoleFrame} = devtools.require("devtools/webconsole/webconsole");

Although this works in a normal (old style) addon, with cfx run I get:

ModuleNotFoundError: unable to satisfy: require(devtools/webconsole/webconsole) from
(thefilename.js)

To clarify, I'm trying to add those 2 lines into here: https://github.com/DavidBruant/usefulStackTrace/blob/master/lib/trackStack.js

Is this not possible within the Addon SDK's restartless addon system?

Upvotes: 2

Views: 155

Answers (1)

paa
paa

Reputation: 5054

A quick-and-not-so-dirty workaround

var {WebConsoleFrame} = devtools["require"]("devtools/webconsole/webconsole");

Upvotes: 4

Related Questions