We allow external OAuth using PHP APIs to several social networks. When the user choose external authentication, a new window (popup) is opened, where the application asks authorization. Then, still in the popup, the user is redirected using the callback url given to the external application. The callback script performs various tasks (login, checks, synchronization,...) that may requires some time, before the popup is closed, and the mother page updated. While those task are performed, the popup is just blank.
What I would like is to display a "please wait..." message on the popup when the callback url is called. One solution is that the popup just display the message and pass an AJAX, but as I don't know the parameters of the callback (that depends on the external application), I would like to avoid this. Is there any way to do it with only one PHP script ?
You can perform the authorization in an iFrame (will require additional work to sync the iframe with the popup to get to the behaviour you have in mind) and design the window as you desire.
You can also just set the title.As the service will return you to your server - you can try next: 1. Set transfer encoding to chunked. 2. Echo javascript document.write with loader img. 3. Do your processing. 4. Close the window after processing ends.