Interface nsIPermissionManagerType

Hierarchy

Methods

  • Increases the reference count for this interface. The associated instance will not be deleted unless the reference count is returned to zero.

    Returns

    The resulting reference count.

    Returns number

  • Parameters

    • aIID: object
    • Optional aInstancePtr: object

    Returns any

  • A run time mechanism for interface discovery.

    Returns

    NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.

    aInstancePtr must not be null.

    Parameters

    • aIID: object

      [in] A requested interface IID

    • aInstancePtr: object

      [out] A pointer to an interface pointer to receive the result.

    Returns void

  • Decreases the reference count for this interface. Generally, if the reference count returns to zero, the associated instance is deleted.

    Returns

    The resulting reference count.

    Returns number

  • Add permission information for a given principal. It is internally calling the other add() method using the nsIURI from the principal. Passing a system principal will be a no-op because they will always be granted permissions.

    Parameters

    • principal: nsIPrincipal
    • type: string
    • permission: uint32_t
    • expireType: uint32_t
    • expireTime: int64_t

    Returns void

  • Add permanent permission information for a given principal in private browsing.

    Normally permissions in private browsing are cleared at the end of the session, this method allows you to override this behavior and set permanent permissions.

    WARNING: setting permanent permissions will leak data in private browsing. Only use if you understand the consequences and trade-offs. If you are unsure, |addFromPrincipal| is very likely what you want to use instead.

    Parameters

    • principal: nsIPrincipal
    • type: string
    • permission: uint32_t

    Returns void

  • Get the permission object associated with the given principal and action.

    Returns

    The matching permission object, or null if no matching object was found. No matching object is equivalent to UNKNOWN_ACTION.

    Note

    Clients in general should prefer the test* methods unless they need to know the specific stored details.

    Note

    This method will always return null for the system principal.

    Parameters

    • principal: nsIPrincipal

      The principal

    • type: string

      A case-sensitive ASCII string identifying the consumer

    • exactHost: boolean

      If true, only the specific host will be matched. If false, base domains of the principal will also be searched.

    Returns nsIPermission

  • Clear permission information for all websites.

    Returns void

  • Clear all permission information added since the specified time.

    Parameters

    • since: int64_t

    Returns void

  • Clear all permissions of the passed type.

    Parameters

    • type: string

    Returns void

  • Clear all permissions of the passed type added since the specified time.

    Parameters

    • type: string

      a case-sensitive ASCII string, identifying the permission.

    • since: int64_t

      a unix timestamp representing the number of milliseconds from Jan 1, 1970 00:00:00 UTC.

    Returns void

  • Remove permission information for a given principal. This is internally calling remove() with the host from the principal's URI. Passing system principal will be a no-op because we never add them to the database.

    Parameters

    • principal: nsIPrincipal
    • type: string

    Returns void

  • Remove the given permission from the permission manager.

    Parameters

    • perm: nsIPermission

      a permission obtained from the permission manager.

    Returns void

  • Remove all permissions that will match the origin pattern.

    Parameters

    • patternAsJSON: string

    Returns void

  • Test whether a website has permission to perform the given action ignoring active sessions. System principals will always have permissions granted. This function will perform a pref lookup to permissions.default. if the specific permission type is part of the whitelist for that functionality.

    Parameters

    • principal: nsIPrincipal

      the principal

    • type: string

      a case-sensitive ASCII string, identifying the consumer

    Returns uint32_t

  • Test whether the principal has the permission to perform a given action. This requires an exact hostname match. Subdomain principals do not match permissions of base domains. System principals will always have permissions granted. This function will perform a pref lookup to permissions.default. if the specific permission type is part of the whitelist for that functionality.

    Parameters

    • principal: nsIPrincipal
    • type: string

    Returns uint32_t

  • Test whether the principal has the permission to perform a given action. System principals will always have permissions granted. This function will perform a pref lookup to permissions.default. if the specific permission type is part of the whitelist for that functionality.

    Parameters

    • principal: nsIPrincipal
    • type: string

    Returns uint32_t

Generated using TypeDoc