search

Home  >  Q&A  >  body text

Google Earth ee.data.authenticateViaPopup is blocked by persistent pop-ups

<p>When I implement the example of Google Authentication in the Google Earth JavaScript API, the popup login window is blocked and the following message is displayed on the console: </p> <p>Cross-Origin-Opener-Policy policy will prevent window.closed calls. Lv @ cb=gapi.loaded_0?le=scs:406</p> <p>I tried adding response headers: </p> <pre class="brush:php;toolbar:false;">var xhr = new XMLHttpRequest(); xhr.open('POST', url); xhr.setRequestHeader('Cross-Origin-Opener-Policy', 'same-origin-allow-popups'); xhr.setRequestHeader('Access-Control-Allow-Origin', '*'); xhr.send(); var head1 = document.getElementsByTagName('head')[0]; var meta1 = document.createElement('meta'); meta1.httpEquiv = 'Permissions-Policy'; meta1.content = 'ch-ua-form-factor=()'; head1.appendChild(meta1);</pre> <p>I added the permissions policy because I was getting a warning. </p> <p>This script has no effect. </p> <p>Please help. </p>
P粉124890778P粉124890778464 days ago490

reply all(1)I'll reply

  • P粉726133917

    P粉7261339172023-08-19 13:42:40

    The pop-up window was closed because I was already logged in. ee.data.authenticateViaOauth() doesn't work.

    reply
    0
  • Cancelreply