Readonly
domainOptional
aInstancePtr: objectA run time mechanism for interface discovery.
NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.
aInstancePtr must not be null.
[in] A requested interface IID
[out] A pointer to an interface pointer to receive the result.
Per-domain controls to enable and disable script. This system is designed to be used by at most one consumer, and enforces this with its semantics.
Initially, domainPolicyActive is false. When activateDomainPolicy() is invoked, domainPolicyActive becomes true, and subsequent calls to activateDomainPolicy() will fail until deactivate() is invoked on the nsIDomainPolicy returned from activateDomainPolicy(). At this point, domainPolicyActive becomes false again, and a new consumer may acquire control of the system by invoking activateDomainPolicy().
Only the parent process can directly access domain policies, child processes only have a read-only mirror to the one in the parent. For child processes the mirror is updated via messages and ContentChild will hold the DomainPolicy by calling ActivateDomainPolicyInternal directly. New consumer to this function should not be addded.
For each of these hooks returning NS_OK means 'let the action continue'. Returning an error code means 'veto the action'. XPConnect will return false to the js engine if the action is vetoed. The implementor of this interface is responsible for setting a JS exception into the JSContext if that is appropriate.
Check that the script currently running in context "cx" can load "uri".
Will return error code NS_ERROR_DOM_BAD_URI if the load request should be denied.
the JSContext of the script causing the load
the URI that is being loaded
Same as the above, but when called from JS, raises exceptions with more useful messages, including both the tested URI and the principal string.
Similar to checkLoadURIWithPrincipal but there are two differences:
Same as the above, but when called from JS, raises exceptions with more useful messages, including both the tested URI and the principal string.
Check that content with principal aPrincipal can load "uri".
Will return error code NS_ERROR_DOM_BAD_URI if the load request should be denied.
the principal identifying the actor causing the load
the URI that is being loaded
the permission set, see above
the window ID for error reporting. If this is 0 (which happens automatically if it's not passed from JS), errors will only appear in the browser console, not window-associated consoles like the web console.
Returns OK if aSourceURI and target have the same "origin" (scheme, host, and port). ReportError flag suppresses error reports for functions that don't need reporting. FromPrivateWindow indicates whether the error occurs in a private window or not.
Returns a principal whose origin is composed of |uri| and |originAttributes|. See nsIPrincipal.idl for a description of origin attributes, and ChromeUtils.webidl for a list of origin attributes and their defaults.
Returns a principal whose origin is the one we pass in. See nsIPrincipal.idl for a description of origin attributes, and ChromeUtils.webidl for a list of origin attributes and their defaults.
Returns a unique nonce principal with |originAttributes|. See nsIPrincipal.idl for a description of origin attributes, and ChromeUtils.webidl for a list of origin attributes and their defaults.
Temporary API until bug 1220687 is fixed.
Returns the same value as getChannelResultPrincipal, but ignoring sandboxing. Specifically, if sandboxing would have prevented the channel's triggering principal from being returned by getChannelResultPrincipal, the triggering principal will be returned by this method.
Note that this method only ignores sandboxing of the channel in question, it does not ignore sandboxing of any channels further up a document chain. The triggering principal itself may still be the null principal due to sandboxing further up a document chain. In that regard the ignoring of sandboxing is limited.
This method returns 2 principals from a nsIChannel:
Get the storage principal for the given channel. This is basically the same of getChannelResultPrincipal() execept for trackers, where we return a principal with a different OriginAttributes.
Query mechanism for the above policy.
If domainPolicyEnabled is false, this simply returns the current value of javascript.enabled. Otherwise, it returns the same value, but taking the various blocklist/allowlist exceptions into account.
Generated using TypeDoc
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.