Note that there are some explanatory texts on larger screens.

plurals
  1. POGoogle authorize popup gets stuck in chrome extension
    primarykey
    data
    text
    <p>I am using <a href="https://code.google.com/p/google-api-javascript-client/wiki/GettingStarted" rel="nofollow noreferrer">gapi</a> client in a chrome extension to access Google Drive. First step is to authorize my app. I am using gapi.auth.authorize to start the authorization. After I authorize the app through a popup launched by gapi, the window never closes and gets stuck like shown in picture below. However authorization has succeeded in the background, because if I close window manually, I don't see the stuck popup next time. Can somebody point out what am I doing wrong?</p> <p><strong>After I click 'Allow access' on authorization popup,</strong> </p> <p><img src="https://i.stack.imgur.com/2deAD.png" alt="enter image description here"></p> <p><strong>It then shows a blank popup which is stuck</strong></p> <p><img src="https://i.stack.imgur.com/ZxfWn.png" alt="Popup gets stuck"></p> <p><strong>Code I am using</strong></p> <pre><code>function handleClientLoad(){ gapi.client.setApiKey('My API key'); window.setTimeout(checkAuthAuto, 1); } var checkAuthAuto = function () { console.log('checkAuthAuto'); gapi.auth.authorize({ client_id: 'My client id', scope: 'https://www.googleapis.com/auth/drive.file', immediate: true }, handleAuthResult); } function handleAuthResult(authResult) { console.log('handleAuthResult'); var authButton = document.getElementById('authorizeButton'); var filePicker = document.getElementById('filePicker'); var addButton = document.getElementById('addButton'); authButton.style.display = 'none'; filePicker.style.display = 'none'; addButton.style.display = 'none'; if (authResult &amp;&amp; !authResult.error) { addButton.style.display = 'block'; addButton.onclick = uploadFile; console.log('handleAuthResult:noerror'); } else { // No access token could be retrieved, show the button to start the authorization flow. authButton.style.display = 'block'; console.log('handleAuthResult:error'); console.log(authResult); authButton.onclick = function() { console.log('authButton.onclick'); gapi.client.setApiKey('My api key'); gapi.auth.authorize({ client_id: 'My client id', scope: 'https://www.googleapis.com/auth/drive.file', immediate: false }, handleAuthResult); return false; }; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload