Jose Álvarez
Jose Álvarez

Reputation: 11

Capture load event on popup JavaScript

I'm tiring to login with google on popup window, that of course I'm opening in my code with window.open(). The problem is that I couldn't listen load envent on the new window because, the popup belong to other domain (google) and the event is Blocked by JavaScript.

I need to know when the popup is opened and when de user is logged in (url changes, and navigate to my own callback page).

Please can someone help me!!!

Thanks very much.

Upvotes: 0

Views: 192

Answers (1)

Jeremy J Starcher
Jeremy J Starcher

Reputation: 23863

There is no way to do that with a site that does not cooperate.

If you are trying to use Google as a login service for your site, you can look at OAUTH.

The way it works is, in short:

  • Call Google
  • Give them a web page to call if the login works.

Upvotes: 1

Related Questions