B2G/gecko/browser/base/content/browser.js
// This will switch to the tab in aWindow having aURI, if present.
This will switch to the tab in aWindow having aURI, if present.
This will switch to the tab in aWindow having aURI if present .
function switchIfURIInWindow(aWindow) {
    let browsers = aWindow.gBrowser.browsers;
    for (let i = 0; i < browsers.length; i++) {
      let browser = browsers[i];
      if (browser.currentURI.equals(aURI)) {
        aWindow.focus();
        aWindow.gBrowser.tabContainer.selectedIndex = i;
        return true;
      }
    }
    return false;
  }
function switchIfURIInWindow ( aWindow ) { let browsers = aWindow . gBrowser . browsers ; for ( let i = 0 ; i < browsers . length ; i ++ ) { let browser = browsers [ i ] ; if ( browser . currentURI . equals ( aURI ) ) { aWindow . focus ( ) ; aWindow . gBrowser . tabContainer . selectedIndex = i ; return true ; } } return false ; }
This will switch to the tab in aWindow having aURI, if present.
This will switch to the tab in aWindow having aURI if present .
// Focus the matching window & tab