アムが動作していません。クロームでは、サウンドクラウドのポップアップが正しく表示され、サインインできます(sc-connect.htmlに戻る)が、ウィンドウは閉じません。より詳しく調べると、window.openerがnullなのでjavascriptエラーがあります。 localhost uriと関係があるのだろうか?上のリンクの例は、firefoxとchromeの両方で動作します。何か案は?以下の私のコード:JavascriptのSDK接続()関数は、クロム、ここで例の後に私のコードをモデル化しようとする
SC.initialize({client_id:'my_client_id', redirect_uri:'http://localhost:3000/sc-connect.html'});
$('button').click(function(){
SC.connect(function() {
console.log('made it');
}
}
マイSC-connect.htmlページには次のようになります。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Connect with SoundCloud</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>
<body onload="window.opener.setTimeout(window.opener.SC.connectCallback, 1)">
<b style="width: 100%; text-align: center;">This popup should automatically close in a few seconds</b>
</body>
</html>
は、このアプリのためてSoundcloudにURIをリダイレクト:http://localhost:3000/sc-connect.html
okだから、上記のコードはfirefox、safari、およびchromiumでは動作しますが、chromeでは機能しません(拡張子なしのiicognitoでも)。異なる可能性があります。クロムとクロムの間 – jeffthink