0

我不确定它说 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);
    }
  }
};
4

1 回答 1

0

我一直在担心同样的状态。但是我刚刚用 "setTimeout" 清除了这个状态,但是 chrome 版本是 29.x。程序代码在这里...

文件名:chrome_ex_oauth.js 行:约 77

77>  chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) {

      //original_midify/////////////////////////////////////////////////
      setTimeout(function(){

78>    if (changeInfo.url &&
79>      changeInfo.url.substr(0, url_match.length) === url_match &&
80>      changeInfo.url != tabs[tabId] &&
81>        window.chromeExOAuthRequestingAccess == false) {
82>      chrome.tabs.create({ 'url' : changeInfo.url }, function(tab) {
83>        tabs[tab.id] = tab.url;
84>        chrome.tabs.remove(tabId);
85>      });
86>    }

      //original_midify/////////////////////////////////////////////////
      },500);

87>  });

如何?

于 2013-09-28T06:31:32.927 回答