【问题标题】:Thunderbird78+: How to check for message create, reply and forwardThunderbird 78:如何检查消息创建、回复和转发
【发布时间】:2021-02-24 03:10:53
【问题描述】:
【问题讨论】:
标签:
thunderbird
thunderbird-addon
thunderbird-webextensions
【解决方案1】:
看起来setComposeDetails() 就是你想要的。
setComposeDetails(tabId, details)
更新撰写窗口。仅指定要更改的字段。目前只实现了 to/cc/bcc/replyTo/followupTo/newsgroups 字段和主题。
我已经注意到尝试过,但我想ComposeDetails 对象中的details.body 或details.plainTextBody 都可以用来传递您要使用的默认文本。所以我会在后台脚本中尝试这样的事情:
let details = {
body: "This is my default text",
};
browser.messages.setComposeDetails(tabId, details);
如果details 中的空字段重置作曲家窗口中的值(我不知道),您可能必须将它与对messages.getComposeDetails() 的调用结合使用。
如果您想在用户打开新的撰写窗口时调用它,我会查看window.onCreated 事件。如果您想在发送消息之前立即执行此操作,则应查看compose.onBeforeSend 事件。所有这些都在 API 文档中进行了描述。