从暂存器访问Add-on SDK模块 [英] Access Add-on SDK module from the scratchpad
问题描述
我想使用暂存器测试附加代码的小片段。在这种情况下,我试图访问通知模块,如下所示:
const {notify} = require(sdk /通知);
notify({
//我的通知的选项
});
正如所料,我得到错误 编辑:Google搜索后,发现 scratch-kit(github),这个插件正是我正在做的事情。但是不幸的是 ,所以我提交了一个bug ,希望这个功能会被添加到devtools中。 目前没有办法做到这一点。一些事情可能会发生,使人们可以观看/贡献的可能性: I'd like to test small snippets of my add-on code using the scratchpad. In this case, I'm trying to access the notifications module like so: As expected, I get the error Edit: After some Googling, I found scratch-kit (github), an add-on that does exactly what I'm trying to do. But it is unfortunately broken, so I've filed a bug in hopes that this functionality will be added to the devtools. At the moment there isn't a way to do this. A few things could happen to make this possible which people can watch/contribute:
这篇关于从暂存器访问Add-on SDK模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! Exception:require is not defined
。由于附件SDK与Firefox打包在一起,所以我想知道是否有方法直接从暂存器访问模块。感谢。
const { notify } = require("sdk/notifications");
notify({
//My notification's options
});
Exception: require is not defined
. As the Add-on SDK is packaged with Firefox, I'm wondering if there's a way to access the modules directly from the scratchpad. Thanks.