I'm working on a FF-extension, that displays user-specific information on 3rd-party websites. Users need to be logged in to my Drupal-website. I'm checking login state with a cross-domain-proof
jQuery.ajax(). If a user is not logged in, the FF-extension opens a popup-window (
window.open()) showing a Drupal login/register/passwordlost page (/user/login).
Now I would like this window to close and the FF-extension to carry on, as soon as the login (registration/password-request) is successful. And now I'm lost. How would I do this?
I know how to close the popup from my FF-addon (
window.close()), but I don't know how to tell the addon, when to do it. I thought of polling the login-state. But that seems kind of clumsy, no? I have also tried redirecting the drupal-page after successful login (login destination module) to a self-closing page, but in newer browsers
window.close() works only on windows, that were created with the same script. And then I would still have to find a way to tell the FF-addon to proceed.
How do other people solve this?