gpt4 book ai didi

google-chrome - Chrome 扩展 oAuth 请求重定向页面未加载

转载 作者:行者123 更新时间:2023-12-04 05:35:57 26 4
gpt4 key购买 nike

我正在开发与 Google 日历交互的 Chrome 扩展程序。我已经开源了,代码可以在GitHub上找到:https://github.com/joshholat/Add-to-Calendar-Chrome-Extension

它需要使用 Google 的 oAuth 进行授权才能编辑用户日历。直到最近,这都运行良好。然而,有一天它由于某种原因停止工作。当我执行以下代码时,它会从 oauth 中打开一个新选项卡,该选项卡应该请求许可,但是页面永远不会加载,而是卡住在“重定向...”上。因此,我无法授权和测试我的代码。

想法?

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': 'http://www.google.com/calendar/feeds/',
'app_name': 'Add Events to Google Calendar'

});

oauth.authorize(function() {
警报(“认证”);
});

最佳答案

在将以下权限添加到 manifest.json 后,我开始工作了

"permissions": [
"tabs",
"https://www.google.com/"
],

关于google-chrome - Chrome 扩展 oAuth 请求重定向页面未加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4170468/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com