Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check whether the experiment can be replaced by a compose script #20

Open
marph91 opened this issue Feb 5, 2023 · 2 comments
Open

Check whether the experiment can be replaced by a compose script #20

marph91 opened this issue Feb 5, 2023 · 2 comments

Comments

@marph91
Copy link
Owner

marph91 commented Feb 5, 2023

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
Copy link
Owner Author

marph91 commented Jul 15, 2023

Another advantage: strict_max_version wouldn't be necessary anymore.

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

marph91 added a commit that referenced this issue Jul 15, 2023
@marph91
Copy link
Owner Author

marph91 commented Mar 12, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant