【发布时间】:2013-07-26 05:09:31
【问题描述】:
相关问题:OAuth (Instagram) without refresh
情况
Instagram 需要一个完整的重定向来进行身份验证,然后他们会重定向回来。我希望它与弹出窗口一起使用。
可能的解决方案
在弹出窗口中打开页面:
var authWindow = window.open(instagramUrl, 'authWindow');
然后我将 instagram 重定向到一个自行关闭的页面:
<script>window.close()</script>
问题
我不知道如何找出窗口何时关闭。以下都不起作用:
authWindow.onbeforeunload = function() {
window.opener.console.log('Closing popup!');
};
function logClose(cnsl) { cnsl.log('Closing popup!'); }
var callback = _.bind(logClose, window, console);
$(authWindow.document).click(callback);
非常欢迎其他建议!
【问题讨论】:
标签: javascript instagram