How to close login-popup after successful login
The user login form is the one returned from user_login(), or user_login_block(). In both the cases, user_login_submit() is the form submission handler that is invoked for the login form.

Adding a form submission handler that is executed after user_login_submit() would be possible to set a Drupal variable.

function mymodule_form_user_login_form(&amp;$form, &amp;$form_state) {
  $form['#submit'][] = 'mymodule_login_submit';
}

function mymodule_login_submit($form, &amp;$form_state) {
  global $user;

  variable_set('mymodule_user_logged_in', (integer) !empty($user));
}


The addon could then periodically ping a URL handled from the module, which would return the value of "mymodule_user_logged_in," and close the window when its value is not 0.
The code I wrote here is not optimized, and it serves only as example of what is possible to do.

To allow to the added form submission handler to be called after the submission handler added by user.module, the weight of the module should be changed to a value that is different from the default module weight, in hook_install() or hook_update_N().

function mymodule_install() {
  db_update('system')
    -&gt;fields(array('weight' =&gt; 10))
    -&gt;condition('name', 'mymodule')
    -&gt;execute();
}