[英]Difference of the "Browser." and "Messenger." when using a webextension/javascript API
Good day, I am new to using webextension and javascript apis.美好的一天,我是使用 webextension 和 javascript apis 的新手。 Just wondering what is the difference of using messsenger.(API) and Browser.(API)
只是想知道使用 messenger.(API) 和 Browser.(API) 有什么区别
I'm not 100% sure, but my understanding is that the following: Both browser
and messenger
are namespaces that can be used to call WebExtension API in Thunderbird.我不是 100% 确定,但我的理解是:
browser
和messenger
都是可用于在 Thunderbird 中调用 WebExtension API 的命名空间。 I suppose that browser
exists because it was inherited from Firefox, from which Thunderbird gets some of the code for WebExtensions (they have many APIs in common).我想
browser
存在是因为它继承自 Firefox,Thunderbird 从中获取了一些 WebExtensions 的代码(它们有许多共同的 API)。 But Thunderbird is not meant to be a browser, above all it's an email client.但 Thunderbird 并不是一个浏览器,最重要的是它是一个电子邮件客户端。 So I suppose the
messenger
namespace was added to reflect that.所以我想添加了
messenger
命名空间来反映这一点。
This seems to be corroborated by the documentation for the MailExtensions API MailExtensions API的文档似乎证实了这一点
In Thunderbird, all WebExtension API can be accessed through the browser.* namespace, as with Firefox, but also through the messenger.* namespace, which is a better fit for Thunderbird.
在 Thunderbird 中,所有 WebExtension API 都可以通过browser.*命名空间访问,与 Firefox 一样,但也可以通过更适合 Thunderbird 的messenger.*命名空间访问。
I would see it pretty much as the same thing as WebExtensions being called indifferently WebExtensions or MailExtensions for Thunderbird.我认为它与WebExtensions被无差别地称为 Thunderbird 的WebExtensions或MailExtensions几乎相同。
Assuming my hypothesis is correct, there should be no practical difference in using one over the other.假设我的假设是正确的,使用一个和另一个应该没有实际区别。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.