browser.experiments.scratchpad.open(
'{"a":"b","c":{"d":"e"}}', // source code
"bbbb", // window title
"ccc", // text to show in statusbar
true // do pretty printing automatically on load and unload
).then(console.log.bind(console))
The promise is fullfiled when the editor is closed.
The code is under Unlicense.
SVG files contain their licenses inside of them.
This repo contains a pair of extensions.
experiment
directory contains the source of the experimental WebExtensions API for Scratchpad. Install it first.extension
directory contains a simple extension injecting the source edited in Scratchpad into the current webpage. After installation it adds a button. When you click it Scratchpad opens. You can edit the source. After you have edited the source close the Scratchpad window. The source will be injected into the page.