我正在使用Chrome Identity API,以便在Chrome扩展程序中为用户提供Google身份验证.
我按照谷歌的官方教程: 链接Chrome Identity API
chrome.identity.getAuthToken
问题是,当我执行扩展时,我被重定向到此登录页面
铬://铬登入/源= 5
但在成功验证后,我又被重定向到登录页面
问题是什么 ?
的manifest.json
{
"name": "My Extension",
"short_name": "Ex App",
"version": "0.1",
"description": "description",
"manifest_version": 2,
"icons": { "128": "ICONE.png", "48": "ICONE1.png" },
"permissions": ["contextMenus", "identity", "cookies", "http://*/*", "https://*/*", "<all_urls>", "unlimitedStorage"],
"browser_action": {
"default_title": "Title",
"default_icon": "imgIcone.png"
},
"oauth2": {
"client_id": "xxxxxxx",
"scopes": [
"https://www.googleapis.com/auth/userinfo.email"
]
},
"background": {
"scripts": ["background.js"]
},
"content_scripts" : [
{
"matches": ["*://*.google.com/*"], …Run Code Online (Sandbox Code Playgroud)