B2G/gecko/toolkit/mozapps/extensions/AddonManager.jsm
/**
   * Adds a add-on to the list of detected changes for this startup. If
   * addStartupChange is called multiple times for the same add-on in the same
   * startup then only the most recent change will be remembered.
   *
   * @param  aType
   *         The type of change as a string. Providers can define their own
   *         types of changes or use the existing defined STARTUP_CHANGE_*
   *         constants
   * @param  aID
   *         The ID of the add-on
   */
Adds a add-on to the list of detected changes for this startup. If
addStartupChange is called multiple times for the same add-on in the same
startup then only the most recent change will be remembered.

@param  aType
The type of change as a string. Providers can define their own
types of changes or use the existing defined STARTUP_CHANGE_
constants
@param  aID
The ID of the add-on
Adds a add - on to the list of detected changes for this startup . If addStartupChange is called multiple times for the same add - on in the same startup then only the most recent change will be remembered . @param aType The type of change as a string . Providers can define their own types of changes or use the existing defined STARTUP_CHANGE_ constants @param aID The ID of the add - on
function AMI_addStartupChange(aType, aID) {
    if (!aType || typeof aType != "string")
      throw Components.Exception("aType must be a non-empty string",
                                 Cr.NS_ERROR_INVALID_ARG);
    if (!aID || typeof aID != "string")
      throw Components.Exception("aID must be a non-empty string",
                                 Cr.NS_ERROR_INVALID_ARG);
    if (gStartupComplete)
      return;
    for (let type in this.startupChanges)
      this.removeStartupChange(type, aID);
    if (!(aType in this.startupChanges))
      this.startupChanges[aType] = [];
    this.startupChanges[aType].push(aID);
  }
function AMI_addStartupChange ( aType , aID ) { if ( ! aType || typeof aType != "string" ) throw Components . Exception ( "aType must be a non-empty string" , Cr . NS_ERROR_INVALID_ARG ) ; if ( ! aID || typeof aID != "string" ) throw Components . Exception ( "aID must be a non-empty string" , Cr . NS_ERROR_INVALID_ARG ) ; if ( gStartupComplete ) return ; for ( let type in this . startupChanges ) this . removeStartupChange ( type , aID ) ; if ( ! ( aType in this . startupChanges ) ) this . startupChanges [ aType ] = [ ] ; this . startupChanges [ aType ] . push ( aID ) ; }
Adds a add-on to the list of detected changes for this startup.
Adds a add - on to the list of detected changes for this startup .
// Ensure that an ID is only listed in one type of change