Addon SDK error getting devtools module

。_饼干妹妹 提交于 2020-01-04 09:29:14

问题


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?


回答1:


A quick-and-not-so-dirty workaround

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


来源:https://stackoverflow.com/questions/21957176/addon-sdk-error-getting-devtools-module

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!