我在尝试将OAuth与我的Chrome扩展程序集成。我正在按照谷歌教程:https://developer.chrome.com/extensions/tut_oauth.html带有OAuth的Google Chrome扩展程序
我从background.js(由我定义,它由background.html加载)创建ExOauth。
var oauth = ChromeExOAuth.initBackgroundPage({
'request_url': 'https://www.google.com/accounts/OAuthGetRequestToken',
'authorize_url': 'https://www.google.com/accounts/OAuthAuthorizeToken',
'access_url': 'https://www.google.com/accounts/OAuthGetAccessToken',
'consumer_key': 'anonymous',
'consumer_secret': 'anonymous',
'scope': 'https://docs.google.com/feeds/',
'app_name': Test app'
});
oauth.authorize(onAuthorized);
这里是OnAuthorized方法:
onAuthorized = function() {
// Start my application logic.
};
我在这里失去了一些东西?当我加载扩展时,它打开了几个“重定向...”选项卡。
我仍然有这个问题,它不断打开新的选项卡。你是如何解决它的? – avi