[scriptable, uuid(f4d74511-2b2d-4a14-a3e4-a392ac5ac3ff)]
Constants
Methods
Return true if content from the given principal is allowed to execute scripts.
Checks whether the running script is allowed to connect to aTargetURI
[noscript]
void
checkConnect(in JSContextPtr aJSContext, in nsIURI aTargetURI, in string aClassName, in string aProperty)
Check that the function 'funObj' is allowed to run on 'targetObj' Will return error code NS_ERROR_DOM_SECURITY_ERR if the function should not run @param cx The current active JavaScript context. @param funObj The function trying to run.. @param targetObj The object the function will run on.
Check that content from "from" can load "uri". Will return error code NS_ERROR_DOM_BAD_URI if the load request should be denied. @param from the URI causing the load @param uri the URI that is being loaded @param flags the permission set, see above
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. @param cx the JSContext of the script causing the load @param uri the URI that is being loaded
Same as CheckLoadURI but takes string arguments for ease of use by scripts
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. @param aPrincipal the URI causing the load @param uri the URI that is being loaded @param flags the permission set, see above
[noscript]
void
checkLoadURIWithPrincipal(in nsIPrincipal aPrincipal, in nsIURI uri, in unsigned long flags)
Checks whether the running script is allowed to access aProperty.
Returns OK if aJSContext and target have the same "origin" (scheme, host, and port).
Returns OK if aSourcePrincipal and aTargetPrincipal have the same "origin" (scheme, host, and port).
[noscript]
void
checkSameOriginPrincipal(in nsIPrincipal aSourcePrincipal, in nsIPrincipal aTargetPrincipal)
Returns OK if aSourceURI and target have the same "origin" (scheme, host, and port).
Disable 'capability' in the innermost frame of the currently executing script.
Enable 'capability' in the innermost frame of the currently executing script.
Return a principal with the specified certificate fingerprint, subject name (the full name or concatenated set of names of the entity represented by the certificate), pretty name, certificate, and codebase URI. The certificate fingerprint and subject name MUST be nonempty; otherwise an error will be thrown. Similarly, aCert must not be null.
[noscript]
nsIPrincipal
getCertificatePrincipal(in AUTF8String aCertFingerprint, in AUTF8String aSubjectName, in AUTF8String aPrettyName, in nsISupports aCert, in nsIURI aURI)
Return a principal that has the same origin as aURI.
Return the principal of the specified object in the specified context.
Returns the principal of the global object of the given context, or null if no global or no principal.
Return the principal of the innermost frame of the currently executing script. Will return null if there is no script currently executing.
Return the all-powerful system principal.
Return true if the currently executing script has 'capability' enabled.
Request that 'capability' can be enabled by scripts or applets running with 'principal'. Will prompt user if necessary. Returns nsIPrincipal::ENABLE_GRANTED or nsIPrincipal::ENABLE_DENIED based on user's choice.
Remove 'capability' from the innermost frame of the currently executing script. Any setting of 'capability' from enclosing frames thus comes into effect.
Utility method for comparing two URIs. For security purposes, two URIs are equivalent if their schemes, hosts, and ports (if any) match. This method returns true if aSubjectURI and aObjectURI have the same origin, false otherwise.
Allow 'certificateID' to enable 'capability.' Can only be performed by code signed by the system certificate.
Compare to: