@mozilla.org/layout/content-policy;1

This component implements the following interfaces:

Constants

PRUint32 nsIContentPolicy.TYPE_OTHER = 1
Indicates an executable script (such as JavaScript).
PRUint32 nsIContentPolicy.TYPE_SCRIPT = 2
Indicates an image (e.g., IMG elements).
PRUint32 nsIContentPolicy.TYPE_IMAGE = 3
Indicates a stylesheet (e.g., STYLE elements).
PRUint32 nsIContentPolicy.TYPE_STYLESHEET = 4
Indicates a generic object (plugin-handled content typically falls under this category).
PRUint32 nsIContentPolicy.TYPE_OBJECT = 5
Indicates a document at the top-level (i.e., in a browser).
PRUint32 nsIContentPolicy.TYPE_DOCUMENT = 6
Indicates a document contained within another document (e.g., IFRAMEs, FRAMES, and OBJECTs).
PRUint32 nsIContentPolicy.TYPE_SUBDOCUMENT = 7
Indicates a timed refresh.

ShouldLoad will never get this, because it does not represent content to be loaded (the actual load triggered by the refresh will go through shouldLoad as expected).

ShouldProcess will get this for, e.g., META Refresh elements and HTTP Refresh headers.

PRUint32 nsIContentPolicy.TYPE_REFRESH = 8
Returned from shouldLoad or shouldProcess if the load or process request is rejected based on details of the request.
PRInt16 nsIContentPolicy.REJECT_REQUEST = -1
Returned from shouldLoad or shouldProcess if the load/process is rejected based solely on its type (of the above flags).

NOTE that it is not meant to stop future requests for this type--only the current request.

PRInt16 nsIContentPolicy.REJECT_TYPE = -2
Returned from shouldLoad or shouldProcess if the load/process is rejected based on the server it is hosted on or requested from (aContentLocation or aRequestOrigin), e.g., if you block an IMAGE because it is served from goatse.cx (even if you don't necessarily block other types from that server/domain).

NOTE that it is not meant to stop future requests for this server--only the current request.

PRInt16 nsIContentPolicy.REJECT_SERVER = -3
Returned from shouldLoad or shouldProcess if the load/process is rejected based on some other criteria. Mozilla callers will handle this like REJECT_REQUEST; third-party implementors may, for example, use this to direct their own callers to consult the extra parameter for additional details.
PRInt16 nsIContentPolicy.REJECT_OTHER = -4
Returned from shouldLoad or shouldProcess if the load or process request is not rejected.
PRInt16 nsIContentPolicy.ACCEPT = 1

Methods

InterfaceMethod
nsIContentPolicy PRInt16 shouldLoad ( PRUint32 contentType , nsIURI contentLocation , nsIURI requestOrigin , nsISupports context , ACString mimeTypeGuess , nsISupports extra )
nsIContentPolicy PRInt16 shouldProcess ( PRUint32 contentType , nsIURI contentLocation , nsIURI requestOrigin , nsISupports context , ACString mimeType , nsISupports extra )

Reference documentation is generated from Mozilla's source.

Add a note User Contributed Notes
No comments available

Copyright © 1999 - 2005 XULPlanet.com