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 } =
By now there is a relatively simple way to do this. The following code works fine if executed in privileged context (meaning switching Scratchpad's environment to "Browser"):
let {require} = Cu.import("resource://gre/modules/commonjs/toolkit/require.js", {});
let {notify} = require("sdk/notifications");
This is supported starting with Firefox 36 but not really documented as of now - meaning that this might stop working in future.
For reference: pull request #1679 added this functionality (not meant for external use it seems).