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:
const { notify } = require("sdk/notifications");
notify({
//My notification's options
});
As expected, I get the error 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.
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: