Popup blocking the gdrive authorization in chrome

前端 未结 5 1626
太阳男子
太阳男子 2020-12-18 09:23

So, the problem is that popup blocking the window open even if it is done by a user action, click for example..

gapi.auth.authorize({
   client_id: this.clie         


        
5条回答
  •  醉梦人生
    2020-12-18 10:27

    Popups that don't originate from user events will get blocked depending on your browser's settings. You can try setting immediate to false:

    gapi.auth.authorize({
       client_id: this.client_id,
       scope: this.scopes,
       immediate: false
    }, function(authResult) {
       console.log(authResult)
    });
    

    You can use this code to refresh the access token after you've already authorized the app.

提交回复
热议问题