B2G/gecko/browser/devtools/webconsole/test/head.js
/**
 * Open the Web Console for the given tab.
 *
 * @param nsIDOMElement [aTab]
 *        Optional tab element for which you want open 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
 *        initialization (web-console-created).
 */
Open the Web Console for the given tab.
@param nsIDOMElement [aTab]
Optional tab element for which you want open 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
initialization (web-console-created).
Open the Web Console for the given tab . @param nsIDOMElement [ aTab ] Optional tab element for which you want open 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 initialization ( web - console - created ) .
function openConsole(aTab, aCallback)
{
  function onWebConsoleOpen(aSubject, aTopic)
  {
    if (aTopic == "web-console-created") {
      Services.obs.removeObserver(onWebConsoleOpen, "web-console-created");
      aSubject.QueryInterface(Ci.nsISupportsString);
      let hud = HUDService.getHudReferenceById(aSubject.data);
      executeSoon(aCallback.bind(null, hud));
    }
  }
  if (aCallback) {
    Services.obs.addObserver(onWebConsoleOpen, "web-console-created", false);
  }
  HUDService.activateHUDForContext(aTab || tab);
}
function openConsole ( aTab , aCallback ) { function onWebConsoleOpen ( aSubject , aTopic ) { if ( aTopic == "web-console-created" ) { Services . obs . removeObserver ( onWebConsoleOpen , "web-console-created" ) ; aSubject . QueryInterface ( Ci . nsISupportsString ) ; let hud = HUDService . getHudReferenceById ( aSubject . data ) ; executeSoon ( aCallback . bind ( null , hud ) ) ; } } if ( aCallback ) { Services . obs . addObserver ( onWebConsoleOpen , "web-console-created" , false ) ; } HUDService . activateHUDForContext ( aTab || tab ) ; }
Open the Web Console for the given tab.
Open the Web Console for the given tab .