function watcher() {
  // if popup is null then let's clean the intervals.
  if (popup === null) {
    clearInterval(timer);
    timer = null;
    // if popup is not null and it is not closed, then let's set the focus on it... maybe...
  } else if (popup !== null && !popup.closed) {
    popup.focus();
    // if popup is closed, then let's clean errthing.
  } else if (popup !== null && popup.closed) {
    clearInterval(timer);
    browser.focus();
    // the onCloseEventHandler it notifies that the child has been closed.
    browser.close({ message: "child was closed" });
    timer = null;
    popup = null;
  }
}
// it checks whether the popup still open or not
it checks whether the popup still open or not
it checks whether the popup still open or not
function watcher() {
  if (popup === null) {
    clearInterval(timer);
    timer = null;
  } else if (popup !== null && !popup.closed) {
    popup.focus();
  } else if (popup !== null && popup.closed) {
    clearInterval(timer);
    browser.focus();
    browser.close({ message: "child was closed" });
    timer = null;
    popup = null;
  }
}
function watcher ( ) { if ( popup === null ) { clearInterval ( timer ) ; timer = null ; } else if ( popup !== null && ! popup . closed ) { popup . focus ( ) ; } else if ( popup !== null && popup . closed ) { clearInterval ( timer ) ; browser . focus ( ) ; browser . close ( { message : "child was closed" } ) ; timer = null ; popup = null ; } }
it checks whether the popup still open or not
it checks whether the popup still open or not
// if popup is null then let's clean the intervals. // if popup is not null and it is not closed, then let's set the focus on it... maybe... // if popup is closed, then let's clean errthing. // the onCloseEventHandler it notifies that the child has been closed.