我查看了Google文档,但我看不到如何更改其类型。
这是我加载时出错的错误。
尝试安装此扩展程序时出现警告: 'browser_action'仅允许用于扩展程序,这是一个传统的打包应用程序。
这是我的manifest.json。
{
"name": "first app",
"description": "this is my first app",
"version": "1.4",
"manifest_version": 2,
"content_security_policy": "script-src 'self' https://en.wiktionary.org/; object-src 'self'",
"background": {
"page": "background.html"
},
"app": {
"launch": {
"local_path": "index.html"
}
},
"browser_action": {
"default_icon": "icon.png"
},
"icons": {
"128": "icon.png",
"16": "icon.png"
},
"permissions": [
"http://*/*",
"https://*/*",
"https://en.wiktionary.org/",
"http://en.wiktionary.org/",
"tabs",
"contextMenus",
"storage",
"unlimitedStorage",
"notifications"]
}
在浏览和存储该文本以便在主页面上查看时,我所拥有的只是一个右键单击事件。我添加了“browser_action”,因为chrome商店并没有让我将我的扩展名作为“遗留打包应用程序”上传,但是我甚至在阅读文档之后并不理解这是什么。
答案 0 :(得分:11)
对于an app,请使用类似以下内容的清单:
{
// Required
"app": {
"background": {
// Optional
"scripts": ["background.js"]
}
},
"manifest_version": 2,
"name": "My App",
"version": "versionString",
...
{
// Required
"manifest_version": 2,
"name": "My Extension",
"version": "versionString",
// Recommended
"default_locale": "en",
"description": "A plain text description",
"icons": {...},
// Pick one (or none)
"browser_action": {...},
"page_action": {...},
...