Yonggang Luo <[email protected]> writes:
> I was trying to use require('sdk/') to import
> some javascript libraries in
> XPCOM javascript components.
> But I can not do that.
You need to import "require" first
const require = Cu.import("resource://gre/modules/devtools/Loader.jsm",
{}).devtools.require;
then you could require the modules you want.
Disclaimer: I don't know whether using sdk modules in XPCOM components
is allowed or not. Presumably you're writing addons then it's ok..
Kanru
_______________________________________________
dev-platform mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-platform