B2G/gecko/browser/devtools/webconsole/test/head.js
/**
 * Close the Web Console for the given tab.
 *
 * @param nsIDOMElement [aTab]
 *        Optional tab element for which you want close the Web Console. The
 *        default tab is taken from the global variable |tab|.
 * @param function [aCallback]
 *        Optional function to invoke after the Web Console completes
 *        closing (web-console-destroyed).
 */
Close the Web Console for the given tab.
@param nsIDOMElement [aTab]
Optional tab element for which you want close the Web Console. The
default tab is taken from the global variable |tab|.
@param function [aCallback]
Optional function to invoke after the Web Console completes
closing (web-console-destroyed).
Close the Web Console for the given tab . @param nsIDOMElement [ aTab ] Optional tab element for which you want close the Web Console . The default tab is taken from the global variable |tab| . @param function [ aCallback ] Optional function to invoke after the Web Console completes closing ( web - console - destroyed ) .
function closeConsole(aTab, aCallback)
{
  function onWebConsoleClose(aSubject, aTopic)
  {
    if (aTopic == "web-console-destroyed") {
      Services.obs.removeObserver(onWebConsoleClose, "web-console-destroyed");
      aSubject.QueryInterface(Ci.nsISupportsString);
      let hudId = aSubject.data;
      executeSoon(aCallback.bind(null, hudId));
    }
  }
  if (aCallback) {
    Services.obs.addObserver(onWebConsoleClose, "web-console-destroyed", false);
  }
  HUDService.deactivateHUDForContext(aTab || tab);
}
function closeConsole ( aTab , aCallback ) { function onWebConsoleClose ( aSubject , aTopic ) { if ( aTopic == "web-console-destroyed" ) { Services . obs . removeObserver ( onWebConsoleClose , "web-console-destroyed" ) ; aSubject . QueryInterface ( Ci . nsISupportsString ) ; let hudId = aSubject . data ; executeSoon ( aCallback . bind ( null , hudId ) ) ; } } if ( aCallback ) { Services . obs . addObserver ( onWebConsoleClose , "web-console-destroyed" , false ) ; } HUDService . deactivateHUDForContext ( aTab || tab ) ; }
Close the Web Console for the given tab.
Close the Web Console for the given tab .