thunderbird-joplin-export
thunderbird-joplin-export copied to clipboard
Check whether the experiment can be replaced by a compose script
John Bieling wrote:
To get rid of your Experiment, you could try using a compose script. The compose script is setting up a runtime message listener and does something like this, when triggered:
function getSelectionText() { var text = ""; if (window.getSelection) { text = window.getSelection().toString(); } else if (document.selection && document.selection.type != "Control") { text = document.selection.createRange().text; } return text; }
More about messages and content scripts (which is valid for our compose scripts as well): https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/sendMessage
Example for message display scripts (same thing, but for the message window): https://github.com/thundernest/sample-extensions/tree/master/messageDisplayScript
Another advantage: strict_max_version wouldn't be necessary anymore.
A "strict_max_version" is required for Thunderbird Mail Experiments, including Theme Experiments.
TODO: Is the compose script only for creating new messages or for reading messages, too?