使用chrome.*或浏览器的Firefox/Chrome/MS Edge扩展.*

编程入门 行业动态 更新时间:2024-10-26 02:36:22
本文介绍了使用chrome.*或浏览器的Firefox/Chrome/MS Edge扩展.*的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

因此,我找不到任何有关使用chrome.*或浏览器.*的内容.在某些WebExtension示例中,它使用浏览器.*(browser.runtime.getManifest();) developer.mozilla/zh- US/Add-ons/WebExtensions/API/runtime/getManifest ,在其他情况下则使用chrome.*(chrome.notifications.create), developer.mozilla/zh-CN/Add-ons/WebExtensions/API/notifications .

So I couldn't find anything that talked about using chrome.* or browser.* specifically. In some of the WebExtension examples it uses browser.* (browser.runtime.getManifest();) developer.mozilla/en-US/Add-ons/WebExtensions/API/runtime/getManifest, and in others it uses chrome.* (chrome.notifications.create), developer.mozilla/en-US/Add-ons/WebExtensions/API/notifications.

我不太确定有什么区别.它是上下文相关的吗?我的内容脚本和Firefox的后台脚本中都可以使用chrome.*和browser.*.我也查看了IEs文档,他们使用了浏览器.*(在他们的文档中没有看到chrome.*)

I'm not entirely sure what's the difference. Is it contextual? Both chrome.* and browser.* are available in my content script and in the background script in Firefox. I looked at IEs docs as well and they use browser.* ( didn't see chrome.* in their docs)

我想知道两者之间的区别,Chrome扩展程序仅使用chrome.*还是具有浏览器.*(IE仅具有浏览器.*)吗?

I'd like to know what the difference is between and do Chrome extensions only use chrome.* or does it have browser.* as well (does IE only have browser.*)?

推荐答案

Chrome仅具有chrome.apis. Edge仅具有browser.apis. Firefox同时具有browser.apis和chrome.apis,以与现有的Chrome扩展程序兼容.

Chrome only has chrome.apis. Edge only has browser.apis. Firefox has both browser.apis and chrome.apis for compatibility with existing Chrome extensions.

主要区别在于,在Firefox中,browser.apis使用promises,而chrome.apis使用回调.

The main difference is that in Firefox the browser.apis use promises but the chrome.apis use callbacks.

更多推荐

使用chrome.*或浏览器的Firefox/Chrome/MS Edge扩展.*

本文发布于:2023-11-24 18:45:08,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1626390.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:浏览器   Firefox   chrome   Edge   MS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!