如何检测用户的 Google oauth window 关闭操作

How to detect Google oauth window closed action from user

在我基于网络的应用程序中,我使用 Google 和 Facebook OAuth 登录。

如何在用户关闭 Google 登录 window 时捕获事件?

我想在用户关闭 Google 登录时隐藏我的 gif 加载器 window。

var gmailWindow = window.open('YOUR_GMAIL_URL','Gmail', 'width=800,height=600,scrollbars=yes');
var timer = setInterval(
 function(){
   if(gmailWindow.closed){
     clearInterval(timer);
     alert('window closed')
   }
},10)

试试这个。