B2G/gecko/browser/devtools/scratchpad/scratchpad-manager.jsm
/**
   * Open a new scratchpad window with an optional initial state.
   *
   * @param object aState
   *        Optional. The initial state of the scratchpad, an object
   *        with properties filename, text, and executionContext.
   *
   * @return nsIDomWindow
   *         The opened scratchpad window.
   */
Open a new scratchpad window with an optional initial state.
@param object aState
Optional. The initial state of the scratchpad, an object
with properties filename, text, and executionContext.

@return nsIDomWindow
The opened scratchpad window.
Open a new scratchpad window with an optional initial state . @param object aState Optional . The initial state of the scratchpad an object with properties filename text and executionContext . @return nsIDomWindow The opened scratchpad window .
function SPM_openScratchpad(aState)
  {
    let params = null;
    if (aState) {
      if (typeof aState != 'object') {
        return;
      }
      params = Cc["@mozilla.org/embedcomp/dialogparam;1"]
               .createInstance(Ci.nsIDialogParamBlock);
      params.SetNumberStrings(1);
      params.SetString(0, JSON.stringify(aState));
    }
    let win = Services.ww.openWindow(null, SCRATCHPAD_WINDOW_URL, "_blank",
                                     SCRATCHPAD_WINDOW_FEATURES, params);
    ShutdownObserver.init();
    return win;
  }
function SPM_openScratchpad ( aState ) { let params = null ; if ( aState ) { if ( typeof aState != 'object' ) { return ; } params = Cc [ "@mozilla.org/embedcomp/dialogparam;1" ] . createInstance ( Ci . nsIDialogParamBlock ) ; params . SetNumberStrings ( 1 ) ; params . SetString ( 0 , JSON . stringify ( aState ) ) ; } let win = Services . ww . openWindow ( null , SCRATCHPAD_WINDOW_URL , "_blank" , SCRATCHPAD_WINDOW_FEATURES , params ) ; ShutdownObserver . init ( ) ; return win ; }
Open a new scratchpad window with an optional initial state.
Open a new scratchpad window with an optional initial state .
// Only add the shutdown observer if we've opened a scratchpad window.