gabrielhpugliese
gabrielhpugliese

Reputation: 2588

Chrome blocking the Google Drive authorization popup

I insert the javascript code of Drive SDK this way:

function upload_click(){
  jQuery(this).toggle();
  jQuery.getScript("https://apis.google.com/js/client.js?onload=handleClientLoad");
}

jQuery(document).ready(function(){
  var upload_button = {
    'style': 'height: 30px; width: 100px;',
    'id': 'upload-btn'
  },
      div = 'body',
      $div = jQuery(div);
  $div.append('<input type="file" id="filePicker" style="visibility: hidden" />');
  $div.append('<button style="'+upload_button['style']+'" id="'+upload_button['id']+'">Upload</button>');
  jQuery('#'+upload_button['id']).click(upload_click);

});

Is there any way to Chrome not to block the auth popup after the user click on the Upload Button ? AFAIK, the way it works, it will be always blocked, right ?

To reproduce it, try it here by clicking on "Preview in your Website" and put your Client ID: http://siteapps.com/app/google_drive_upload_widget-342

Thanks in advance

Upvotes: 0

Views: 512

Answers (1)

Ali Afshar
Ali Afshar

Reputation: 41667

Usually if the popup comes from a button click, chrome will allow it. I didn't install it to preview it though, so you may need to inform users to unblock the popup.

Upvotes: 1

Related Questions