我很难将Dropbox与Chrome扩展集成在一起。当试图对Dropbox进行身份验证时,重定向到Dropbox确认/许可页面工作正常,但是重定向回Chrome应用程序失败。这是控制台中的错误:
Denying load of chrome-extension://mlabibnomhfmephibijgghejmmmbigpi/chrome_oauth_receiver.h…sGbCG&token_type=bearer&uid=14169733&state=oas_hquvrf6k_0.ycudjb24vysexw29. Resources must be listed in the web_accessible_resources manifest key in order to be loaded by pages outside the extension.
Chrome似乎正在阻止Dropbox重定向到扩展范围内的页面。几个小时的权限试验没有结果。
这是manifest.json
{
"name": "MyApp",
"description": "Description",
"version": "1.0",
"icons": {"16":"icon.png",
"48":"icon.png",
"128":"icon.png"},
"manifest_version": 2,
"permissions": [
"http://*/*",
"https://*/*",
"<all_urls>",
"tabs",
"storage",
"background",
"bookmarks",
"clipboardRead",
"clipboardWrite",
"contentSettings",
"contextMenus",
"cookies",
"debugger",
"history",
"idle",
"management",
"notifications",
"pageCapture",
"topSites",
"webNavigation",
"webRequest",
"webRequestBlocking"
],
"background": {
"scripts": ["backgroundcollector.js"]
},
"browser_action": {
"default_icon": "icon.png"
},
"web_accessible_resources": [
"http://*/*",
"https://*/*",
"<all_urls>",
"chrome-extension://mlabibnomhfmephibijgghejmmmbigpi/chrome_oauth_receiver.html&response_type=token&state=oas_hquul1r4_0.1qwu7sh12pqzolxr",
"chrome-extension://*/*"
],
"content_security_policy": "script-src 'self' https://www.dropbox.com; object-src 'self'",
"key": "(included so that the extension gets a persistent extensionID)"
}
(大量的权限是大量试验的结果,以使其工作。显然,它们稍后会被移除。)
提前感谢!
发布于 2014-01-25 13:39:54
你的舱单里有一卡车垃圾.
要允许其他网页重定向到扩展名内的页面,您必须将该文件放在"web_accessible_resources"
,没有chrome-extension://..
前缀,如下所示:
"web_accessible_resources": [
"chrome_oauth_receiver.html"
],
您应该请求尽可能少的权限,有关每个权限的描述列表,请参见声明权限。我想你在看完那份文件之后,几乎可以取消所有的许可。
https://stackoverflow.com/questions/21351028
复制相似问题