我不确定它说 Google Doc API 不允许安装桌面应用程序是什么问题,而我相信以前这在 Chrome 27.0 中有效。
这是我的 Manifest.Json 文件:
{
"name": "__MSG_extName__",
"description": "__MSG_extDescription__",
"version": "4.0",
"default_locale": "en_US",
"background": {
"page": "background.html"
},
"offline_enabled": true,
"options_page": "options.html",
"manifest_version": 2,
"app": {
"launch": {
"local_path": "index.html"
}
},
"icons": {
"16": "16icon.png",
"48": "48icon.png",
"128": "icon.png"
},
"permissions": [
"<all_urls>",
"unlimited_storage",
"notifications",
"tabs",
"https://docs.google.com/feeds/*",
"https://www.google.com/accounts/OAuthGetRequestToken",
"https://www.google.com/accounts/OAuthAuthorizeToken",
"https://www.google.com/accounts/OAuthGetAccessToken"
],
"content_security_policy": "script-src 'self'; object-src 'self'",
"web_accessible_resources": [
"chrome_ex_oauthsimple.js",
"chrome_ex_oauth.html",
"back-main.js",
"cloud.js"
]
}
我在 background.html 中也看到了一个错误。
ChromeExOAuth.prototype.onAccessToken = function(callback, xhr) {
if (xhr.readyState == 4) {
var bg = chrome.extension.getBackgroundPage();
if (xhr.status == 200) {
var params = ChromeExOAuth.formDecode(xhr.responseText);
var token = params["oauth_token"];
var secret = params["oauth_token_secret"];
this.setToken(token);
this.setTokenSecret(secret);
bg.chromeExOAuthRequestingAccess = false;
callback(token, secret);
} else {
bg.chromeExOAuthRequestingAccess = false;
throw new Error("Fetching access token failed with status " + xhr.status);
}
}
};