Tags
webextension
Created
Jun 19, 2016 7:38 AM
https://developer.chrome.com/extensions/migrating_to_manifest_v3
Firefox可以指定 id,chrome 扩展id 由 .pem 决定,可以在 chrome 扩展列表和扩展商店中看到
- applications. Only supported in Gecko. // add-on update manifest
- manifest_version
- name
- version
// 以上必须包含,以下可选
- background: implement long-running logic//page不知道会自动创建,script自动插入page,长时间运行的逻辑,可以使用WebE APIs。
- content_scripts: interact with web pages//可以与匹配网页交互(上下文是SandBox,能使用DOM APIs,读取不到页面中定义的变量和修改的内置属性),使用小量WebE APIs,和bg pages通信(chrome.runtime.onMessage.addListener(beastify);), 和网页通信(window.postMessage)
- browser_action: add buttons to the toolbar // popup中的js可以访问WebE APIs
- page_action: add buttons to the address bar//与打开的页面密切相关,内容脚本通知bg脚本 pageAction.show()实现特定网页才显示
- options_ui: define a UI for users to view and change your add-on's settings //
- description
- icons
- commands (不能覆盖浏览器快捷键)
- content_security_policy
- permissions
- default_locale. Must be present if the _locales directory exists, and must be absent otherwise.
- web_accessible_resources: make packaged content accessible to web pages and content scripts(例如加载模块,图片)
- homepage_url
Chrome docs: https://developer.chrome.com/extensions/manifest