thunderbird-joplin-export icon indicating copy to clipboard operation
thunderbird-joplin-export copied to clipboard

Check whether the experiment can be replaced by a compose script

Open marph91 opened this issue 2 years ago • 2 comments
trafficstars

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

marph91 avatar Feb 05 '23 14:02 marph91

Another advantage: strict_max_version wouldn't be necessary anymore.

A "strict_max_version" is required for Thunderbird Mail Experiments, including Theme Experiments.

marph91 avatar Jul 15 '23 15:07 marph91

TODO: Is the compose script only for creating new messages or for reading messages, too?

marph91 avatar Mar 12 '24 15:03 marph91