Interface nsIPrincipalType

Hierarchy

Properties

URI: nsIURI

The principal URI to which this principal pertains. This is generally the document URI.

May be called from any thread.

addonId: string

Gets the ID of the add-on this principal belongs to.

May be called from any thread.

addonPolicy: WebExtensionPolicy

Gets the WebExtensionPolicy of the add-on this principal belongs to.

NOTE: Main-Thread Only.

asciiHost: string

Returns the "host:port" portion of the Principals URI, if any.

May be called from any thread.

asciiOrigin: string

Returns an ASCII compatible representation of the principals Origin

May be called from any thread.

asciiSpec: string

Returns the ASCII Spec from the Principals URI. Might return the empty string, e.g. for the case of a SystemPrincipal or an EpxandedPrincipal.

May be called from any thread.

WARNING: DO NOT USE FOR SECURITY CHECKS. just for logging purposes!

baseDomain: string

The base domain of the principal URI to which this principal pertains (generally the document URI), handling null principals and non-hierarchical schemes correctly.

May be called from any thread.

contentScriptAddonPolicy: WebExtensionPolicy
domain: nsIURI

The domain URI to which this principal pertains. This is null unless script successfully sets document.domain to our URI or a superdomain of our URI. Setting this has no effect on the URI. See https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy#Changing_origin

The getter may be called from any thread, but may only be set on the main thread.

exposablePrePath: string

Returns the Pre Path of the Principals URI with user:pass stripped for privacy and spoof prevention

May be called from any thread.

exposableSpec: string

Returns the Spec of the Principals URI with user/pass/ref/query stripped for privacy and spoof prevention

May be called from any thread.

filePath: string

Returns the filePath of the principals uri. See nsIURI.

May be called from any thread.

hashValue: number

Returns a hash value for the principal.

May be called from any thread.

host: string

Returns the "host" portion of the Principals URI, if any.

May be called from any thread.

hostPort: string

Returns the "host:port" portion of the Principals URI, if any.

May be called from any thread.

isAddonOrExpandedAddonPrincipal: boolean

Returns true iff the principal is either an addon principal or an expanded principal, which contains at least one addon principal.

May be called from any thread.

isContentPrincipal: boolean

Returns true iff this principal corresponds to a principal origin.

May be called from any thread.

isExpandedPrincipal: boolean

Returns true iff this is an expanded principal.

May be called from any thread.

isInIsolatedMozBrowserElement: boolean

Returns true iff the principal is inside an isolated mozbrowser element. xul:browser is not considered to be a mozbrowser element.