B2G/gecko/toolkit/mozapps/extensions/AddonManager.jsm
/**
   * Checks whether installation is enabled for a particular mimetype.
   *
   * @param  aMimetype
   *         The mimetype to check
   * @return true if installation is enabled for the mimetype
   */
Checks whether installation is enabled for a particular mimetype.
@param  aMimetype
The mimetype to check
@return true if installation is enabled for the mimetype
Checks whether installation is enabled for a particular mimetype . @param aMimetype The mimetype to check @return true if installation is enabled for the mimetype
function AMI_isInstallEnabled(aMimetype) {
    if (!gStarted)
      throw Components.Exception("AddonManager is not initialized",
                                 Cr.NS_ERROR_NOT_INITIALIZED);
    if (!aMimetype || typeof aMimetype != "string")
      throw Components.Exception("aMimetype must be a non-empty string",
                                 Cr.NS_ERROR_INVALID_ARG);
    let providers = this.providers.slice(0);
    for (let provider of providers) {
      if (callProvider(provider, "supportsMimetype", false, aMimetype) &&
          callProvider(provider, "isInstallEnabled"))
        return true;
    }
    return false;
  }
function AMI_isInstallEnabled ( aMimetype ) { if ( ! gStarted ) throw Components . Exception ( "AddonManager is not initialized" , Cr . NS_ERROR_NOT_INITIALIZED ) ; if ( ! aMimetype || typeof aMimetype != "string" ) throw Components . Exception ( "aMimetype must be a non-empty string" , Cr . NS_ERROR_INVALID_ARG ) ; let providers = this . providers . slice ( 0 ) ; for ( let provider of providers ) { if ( callProvider ( provider , "supportsMimetype" , false , aMimetype ) && callProvider ( provider , "isInstallEnabled" ) ) return true ; } return false ; }
Checks whether installation is enabled for a particular mimetype.
Checks whether installation is enabled for a particular mimetype .