JVG*_*JVG 0 javascript google-chrome oauth google-chrome-extension
我无法绕过Chrome扩展程序的结构。
我的扩展程序有两个不同的部分:
它使用后台页面通过oAuth登录,然后从oAuth整理大量数据并将其保存到chrome.storage.local。
浏览网页时,它会调用来chrome.storage.local检查当前域是否与从oAuth存储的信息匹配,如果匹配,则使用[Rich Notifications API][1]
我的结构manifest.json很糟糕。
{
"name": "API Test",
"version": "3.1.2",
"manifest_version": 2,
"minimum_chrome_version": "29",
"app": {
"background": {
"scripts": ["main.js"]
}
},
"permissions": ["identity", "storage", "*://*/*"],
"oauth2": {
"client_id": "<<client_id>>",
"scopes": [
"https://www.googleapis.com/auth/plus.login",
"https://www.google.com/m8/feeds",
"https://www.googleapis.com/auth/contacts.readonly"
]
},
"content_scripts": [
{
"matches": ["*://*/*"],
"js": ["domchecker.js"]
}
]
}
Run Code Online (Sandbox Code Playgroud)
这样做时,我从Chrome收到以下错误:
There were warnings when trying to install this extension:
'content_scripts' is only allowed for extensions and
legacy packaged apps, but this is a packaged app.
Run Code Online (Sandbox Code Playgroud)
是否可以同时进行这两个过程?如果没有,如何使用后台页面检查页面刷新并运行脚本?
| 归档时间: |
|
| 查看次数: |
1405 次 |
| 最近记录: |