【问题标题】:How to detect Google oauth window closed action from user如何检测用户的 Google oauth 窗口关闭操作
【发布时间】:2015-04-21 06:37:13
【问题描述】:

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

当用户关闭 Google 登录窗口时如何捕获事件?

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

【问题讨论】:

    标签: javascript google-oauth google-signin


    【解决方案1】:
    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)
    

    试试这个。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-09-15
      • 1970-01-01
      • 2015-10-28
      • 1970-01-01
      • 2010-12-13
      • 2019-05-04
      • 1970-01-01
      相关资源
      最近更新 更多