我想为 Thunderbird 编写一个扩展来修改消息显示(例如插入/替换文本/标记/图像)。
不幸的是,缺少文档(由于最近的更改?)。
https://developer.mozilla.org/en-US/docs/Mozilla/Thunderbird/Thunderbird_extensions
已过时
https://developer.thunderbird.net/
没有有用的例子(还)
可以在以下位置找到一些示例
基于https://github.com/thundernest/sample-extensions/tree/master/messageDisplay
我已经修改了background.js
browser.messageDisplay.onMessageDisplayed.addListener((tabId, message) => {
console.log(`Message displayed in tab ${tabId}: ${message.subject}`);
console.log(message.id);
browser.messages.getFull(message.id).then((messagepart) => {
console.log(messagepart);
body = messagepart['parts'][0]['parts'][0]['body'];
console.log(body);
body += "modified!";
console.log(body);
});
browser.windows.getCurrent().then((window)=>{
console.log(window.type);
});
browser.tabs.getCurrent().then((tab)=>{
console.log("tab",tab);
});
});
Run Code Online (Sandbox Code Playgroud)
这为我提供了消息正文(使用魔术索引),但预计更改不会反映在消息显示中。
返回的窗口类型是normal,不是messageDisplay。
的tab是undefined,尽管添加权限
"permissions": [
"messagesRead",
"activeTab",
"tabs",
"tabHide"
],
Run Code Online (Sandbox Code Playgroud)
但我认为这是因为脚本以background.
所以我需要一个在内容上运行的脚本/对选项卡的访问,然后是一些关于如何修改显示的消息内容的提示(我不想修改消息)。
我在哪里可以找到等效的文档
特定于雷鸟?
content_scripts在 manifest.json 中指定会导致“错误:错误重新加载插件 messageDisplay@sample.extensions.thunderbird.net:未定义”。
executeScript()from …
有没有一种方法可以像通过 addon/webextension 处理应用程序的其他部分一样挂钩 Thunderbird 中的任务?
据我了解,任务是日历的一部分,而日历又属于闪电插件 - 这就是为什么 Thunderbird 开发人员文档中没有涵盖任务的原因?
如果这种方法不可行,那么我想要实现的目标是:我想将我的 todoist 任务与 Thunderbird 任务同步。Todoist本身仅提供与截止日期同步的任务,但这些任务作为日历事件导入,这对我来说没有用,因为许多任务没有截止日期。
唯一能够同步的扩展是 Google 任务的扩展,但是,我无法获得其源代码,也许无法了解他们是如何完成此操作的。
thunderbird thunderbird-lightning thunderbird-addon todoist thunderbird-webextensions