B2G/gecko/browser/components/sessionstore/src/SessionStore.jsm
/**
   * Gets the tab for the given browser. This should be marginally better
   * than using tabbrowser's getTabForContentWindow. This assumes the browser
   * is the linkedBrowser of a tab, not a dangling browser.
   *
   * @param aBrowser
   *        The browser from which to get the tab.
   */
Gets the tab for the given browser. This should be marginally better
than using tabbrowser's getTabForContentWindow. This assumes the browser
is the linkedBrowser of a tab, not a dangling browser.

@param aBrowser
The browser from which to get the tab.
Gets the tab for the given browser . This should be marginally better than using tabbrowser ' s getTabForContentWindow . This assumes the browser is the linkedBrowser of a tab not a dangling browser . @param aBrowser The browser from which to get the tab .
function ssi_getTabForBrowser(aBrowser) {
    let window = aBrowser.ownerDocument.defaultView;
    for (let i = 0; i < window.gBrowser.tabs.length; i++) {
      let tab = window.gBrowser.tabs[i];
      if (tab.linkedBrowser == aBrowser)
        return tab;
    }
  }
function ssi_getTabForBrowser ( aBrowser ) { let window = aBrowser . ownerDocument . defaultView ; for ( let i = 0 ; i < window . gBrowser . tabs . length ; i ++ ) { let tab = window . gBrowser . tabs [ i ] ; if ( tab . linkedBrowser == aBrowser ) return tab ; } }
Gets the tab for the given browser.
Gets the tab for the given browser .