我在 Spotify 上注册了我的应用程序。我确保已将 URI 添加到我注册的应用程序中。但是每次我运行这段代码时,我都会遇到同样的错误。我也在后台运行它,所以我知道不是这样。我究竟做错了什么?
我也尝试/spotify
用/provider_cb
.
var client_id = '<my_client_id>';
var redirectUri = chrome.identity.getRedirectURL() + "/spotify";
chrome.identity.launchWebAuthFlow({
"url": "https://accounts.spotify.com/authorize?client_id="+client_id+
"&redirect_uri="+ encodeURIComponent(redirectUri) +
"&response_type=token",
'interactive': true,
},
function(redirect_url) {
console.log(redirect_url);
});
这是我的权限:
"permissions": [
"http://*/*", "tabs", "webNavigation", "activeTab", "storage", "identity",
"declarativeContent", "https://accounts.spotify.com/*",
"https://accounts.spotify.com/authorize/*"
]
在重新启动 Chrome 后第一次运行我的应用程序时,会弹出登录页面,好像一切都很好,但在我登录后我仍然收到相同的错误:
identity.launchWebAuthFlow: Authorization page could not be loaded.