Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes
nsMsgContentPolicy Class Reference

#include <nsMsgContentPolicy.h>

Inheritance diagram for nsMsgContentPolicy:
Inheritance graph
[legend]
Collaboration diagram for nsMsgContentPolicy:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 nsMsgContentPolicy ()
virtual ~nsMsgContentPolicy ()
nsresult Init ()
short shouldLoad (in unsigned long aContentType, in nsIURI aContentLocation, in nsIURI aRequestOrigin, in nsISupports aContext, in ACString aMimeTypeGuess, in nsISupports aExtra)
 Should the resource at this location be loaded? ShouldLoad will be called before loading the resource at aContentLocation to determine whether to start the load at all.
short shouldProcess (in unsigned long aContentType, in nsIURI aContentLocation, in nsIURI aRequestOrigin, in nsISupports aContext, in ACString aMimeType, in nsISupports aExtra)
 Should the resource be processed? ShouldProcess will be called once all the information passed to it has been determined about the resource, typically after part of the resource has been loaded.
void observe (in nsISupports aSubject, in string aTopic, in wstring aData)
 Observe will be called when there is a notification for the topic |aTopic|.

Public Attributes

const unsigned long TYPE_OTHER = 1
const unsigned long TYPE_SCRIPT = 2
 Indicates an executable script (such as JavaScript).
const unsigned long TYPE_IMAGE = 3
 Indicates an image (e.g., IMG elements).
const unsigned long TYPE_STYLESHEET = 4
 Indicates a stylesheet (e.g., STYLE elements).
const unsigned long TYPE_OBJECT = 5
 Indicates a generic object (plugin-handled content typically falls under this category).
const unsigned long TYPE_DOCUMENT = 6
 Indicates a document at the top-level (i.e., in a browser).
const unsigned long TYPE_SUBDOCUMENT = 7
 Indicates a document contained within another document (e.g., IFRAMEs, FRAMES, and OBJECTs).
const unsigned long TYPE_REFRESH = 8
 Indicates a timed refresh.
const short REJECT_REQUEST = -1
 Returned from shouldLoad or shouldProcess if the load or process request is rejected based on details of the request.
const short REJECT_TYPE = -2
 Returned from shouldLoad or shouldProcess if the load/process is rejected based solely on its type (of the above flags).
const short REJECT_SERVER = -3
 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).
const short REJECT_OTHER = -4
 Returned from shouldLoad or shouldProcess if the load/process is rejected based on some other criteria.
const short ACCEPT = 1
 Returned from shouldLoad or shouldProcess if the load or process request is not rejected.

Protected Member Functions

PRBool IsTrustedDomain (nsIURI *aContentLocation)
 Extract the host name from aContentLocation, and look it up in our list of trusted domains.
nsresult AllowRemoteContentForSender (nsIMsgDBHdr *aMsgHdr, PRBool *aAllowForSender)
 returns true if the sender referenced by aMsgHdr is in one one of our local address books and the user has explicitly allowed remote content for the sender
nsresult AllowRemoteContentForMsgHdr (nsIMsgDBHdr *aMsgHdr, nsIURI *aRequestingLocation, nsIURI *aContentLocation, PRInt16 *aDecision)
 For a given msg hdr, iterate through the list of remote content blocking criteria.
nsresult MailShouldLoad (nsIURI *aRequestingLocation, nsIURI *aContentLocation, PRInt16 *aDecision)
 Content policy logic for mail windows.
nsresult ComposeShouldLoad (nsIDocShell *aRootDocShell, nsISupports *aRequestingContext, nsIURI *aContentLocation, PRInt16 *aDecision)
 Content policy logic for compose windows.
nsresult GetRootDocShellForContext (nsISupports *aRequestingContext, nsIDocShell **aDocShell)
 helper routine to get the root docshell for the window requesting the load
nsresult GetMessagePaneURI (nsIDocShell *aRootDocShell, nsIURI **aURI)
 helper routine to get the current URI loaded in the message pane for the mail window.

Protected Attributes

PRBool mBlockRemoteImages
PRBool mAllowPlugins
nsAdoptingCString mTrustedMailDomains

Detailed Description

Definition at line 65 of file nsMsgContentPolicy.h.


Constructor & Destructor Documentation

Definition at line 108 of file nsMsgContentPolicy.cpp.

{
  // hey, we are going away...clean up after ourself....unregister our observer
  nsresult rv;
  nsCOMPtr<nsIPrefBranch2> prefInternal = do_GetService(NS_PREFSERVICE_CONTRACTID, &rv);
  if (NS_SUCCEEDED(rv))
  {
    prefInternal->RemoveObserver(kBlockRemoteImages, this);
    prefInternal->RemoveObserver(kAllowPlugins, this);
  }
}

Here is the call graph for this function:


Member Function Documentation

nsresult nsMsgContentPolicy::AllowRemoteContentForMsgHdr ( nsIMsgDBHdr aMsgHdr,
nsIURI aRequestingLocation,
nsIURI aContentLocation,
PRInt16 aDecision 
) [protected]

For a given msg hdr, iterate through the list of remote content blocking criteria.

returns nsIContentPolicy::REJECT if the msg hdr fails any of these tests.

Parameters:
aRequestingLocationcannot be null

Definition at line 365 of file nsMsgContentPolicy.cpp.

{
  NS_ENSURE_ARG_POINTER(aMsgHdr);

  PRBool allowRemoteContent = PR_FALSE;

  // Case #1, check the db hdr for the remote content policy on this particular message
  PRUint32 remoteContentPolicy = kNoRemoteContentPolicy;
  aMsgHdr->GetUint32Property("remoteContentPolicy", &remoteContentPolicy);

  // Case #2, check if the message is in an RSS folder
  PRBool isRSS = PR_FALSE;
  IsRSSArticle(aRequestingLocation, &isRSS);

  // Case #3, author is in our white list..
  PRBool allowForSender = PR_FALSE;
  AllowRemoteContentForSender(aMsgHdr, &allowForSender);

  // Case #4, the domain for the remote image is in our white list
  PRBool trustedDomain = IsTrustedDomain(aContentLocation);

  *aDecision = (isRSS || remoteContentPolicy == kAllowRemoteContent || allowForSender || trustedDomain) 
               ? nsIContentPolicy::ACCEPT : nsIContentPolicy::REJECT_REQUEST;

  if (*aDecision == nsIContentPolicy::REJECT_REQUEST && !remoteContentPolicy) // kNoRemoteContentPolicy means we have never set a value on the message
    aMsgHdr->SetUint32Property("remoteContentPolicy", kBlockRemoteContent);

  return NS_OK; // always return success
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsMsgContentPolicy::AllowRemoteContentForSender ( nsIMsgDBHdr aMsgHdr,
PRBool aAllowForSender 
) [protected]

returns true if the sender referenced by aMsgHdr is in one one of our local address books and the user has explicitly allowed remote content for the sender

Definition at line 141 of file nsMsgContentPolicy.cpp.

{
  NS_ENSURE_ARG_POINTER(aMsgHdr); 
  
  nsresult rv;
  *aAllowForSender = PR_FALSE;  

  // extract the e-mail address from the msg hdr
  nsXPIDLCString author;
  rv = aMsgHdr->GetAuthor(getter_Copies(author));
  NS_ENSURE_SUCCESS(rv, rv);

  nsCOMPtr<nsIMsgHeaderParser> headerParser = do_GetService("@mozilla.org/messenger/headerparser;1", &rv);
  NS_ENSURE_SUCCESS(rv, rv);

  nsXPIDLCString emailAddress; 
  rv = headerParser->ExtractHeaderAddressMailboxes(nsnull, author, getter_Copies(emailAddress));
  NS_ENSURE_SUCCESS(rv, rv);

  // Use the RDF service to walk through the list of local directories
  nsCOMPtr<nsIRDFService> rdfService = do_GetService("@mozilla.org/rdf/rdf-service;1", &rv);
  NS_ENSURE_SUCCESS(rv, rv);
    
  nsCOMPtr <nsIRDFResource> resource;
  rv = rdfService->GetResource(NS_LITERAL_CSTRING("moz-abdirectory://"), getter_AddRefs(resource));
  NS_ENSURE_SUCCESS(rv, rv);

  nsCOMPtr <nsIAbDirectory> directory = do_QueryInterface(resource, &rv);
  NS_ENSURE_SUCCESS(rv, rv);

  nsCOMPtr<nsISimpleEnumerator> enumerator;
  rv = directory->GetChildNodes(getter_AddRefs(enumerator));
  NS_ENSURE_SUCCESS(rv, rv);

  nsCOMPtr<nsISupports> supports;
  nsCOMPtr<nsIAbMDBDirectory> mdbDirectory;
  nsCOMPtr<nsIAbCard> cardForAddress;
  PRBool hasMore;

  while (NS_SUCCEEDED(enumerator->HasMoreElements(&hasMore)) && hasMore && !cardForAddress)
  {
    rv = enumerator->GetNext(getter_AddRefs(supports));
    NS_ENSURE_SUCCESS(rv, rv);
    mdbDirectory = do_QueryInterface(supports);
    if (mdbDirectory)
      mdbDirectory->CardForEmailAddress(emailAddress, getter_AddRefs(cardForAddress));
  }
  
  // if we found a card from the sender, 
  if (cardForAddress)
    cardForAddress->GetAllowRemoteContent(aAllowForSender);

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsMsgContentPolicy::ComposeShouldLoad ( nsIDocShell aRootDocShell,
nsISupports *  aRequestingContext,
nsIURI aContentLocation,
PRInt16 aDecision 
) [protected]

Content policy logic for compose windows.

Definition at line 467 of file nsMsgContentPolicy.cpp.

{
  nsresult rv;

  PRBool authorInWhiteList = PR_FALSE;
  PRBool trustedDomain = PR_FALSE;

  nsCOMPtr<nsIDOMWindowInternal> window(do_GetInterface(aRootDocShell, &rv));
  NS_ENSURE_SUCCESS(rv, NS_OK);

  nsCOMPtr<nsIMsgComposeService> composeService (do_GetService(NS_MSGCOMPOSESERVICE_CONTRACTID, &rv));
  NS_ENSURE_SUCCESS(rv, NS_OK);

  nsCOMPtr<nsIMsgCompose> msgCompose;
  rv = composeService->GetMsgComposeForWindow(window, getter_AddRefs(msgCompose));
  NS_ENSURE_SUCCESS(rv, NS_OK);

  nsXPIDLCString originalMsgURI;
  msgCompose->GetOriginalMsgURI(getter_Copies(originalMsgURI));
  NS_ENSURE_SUCCESS(rv, NS_OK);

  MSG_ComposeType composeType;
  rv = msgCompose->GetType(&composeType);
  NS_ENSURE_SUCCESS(rv, NS_OK);

  // Only allow remote content for new mail compositions.
  // Block remote content for all other types (drafts, templates, forwards, replies, etc)
  // unless there is an associated msgHdr which allows the load, or unless the image is being
  // added by the user and not the quoted message content...
  if (composeType == nsIMsgCompType::New)
    *aDecision = nsIContentPolicy::ACCEPT;
  else if (!originalMsgURI.IsEmpty())
  {
    nsCOMPtr<nsIMsgDBHdr> msgHdr;
    rv = GetMsgDBHdrFromURI(originalMsgURI.get(), getter_AddRefs(msgHdr));
    NS_ENSURE_SUCCESS(rv, NS_OK);
    AllowRemoteContentForMsgHdr(msgHdr, nsnull, aContentLocation, aDecision);

    // Special case image elements. When replying to a message, we want to allow the 
    // user to add remote images to the message. But we don't want remote images
    // that are a part of the quoted content to load. Fortunately, after the quoted message
    // has been inserted into the document, mail compose flags remote content elements that came 
    // from the original message with a moz-do-not-send attribute. 
    if (*aDecision == nsIContentPolicy::REJECT_REQUEST)
    {
      PRBool insertingQuotedContent = PR_TRUE;
      msgCompose->GetInsertingQuotedContent(&insertingQuotedContent);
      nsCOMPtr<nsIDOMHTMLImageElement> imageElement = do_QueryInterface(aRequestingContext);
      if (!insertingQuotedContent && imageElement)
      {
        PRBool doNotSendAttrib;
        if (NS_SUCCEEDED(imageElement->HasAttribute(NS_LITERAL_STRING("moz-do-not-send"), &doNotSendAttrib)) && 
            !doNotSendAttrib)
           *aDecision = nsIContentPolicy::ACCEPT;
      }
    }
  }

  return NS_OK;
}

Here is the call graph for this function:

nsresult nsMsgContentPolicy::GetMessagePaneURI ( nsIDocShell aRootDocShell,
nsIURI **  aURI 
) [protected]

helper routine to get the current URI loaded in the message pane for the mail window.

Parameters:
aRootDocShellthe root docshell for a mail window with a message pane (i.e. not a compose window)
Returns:
aURI may be null

Definition at line 556 of file nsMsgContentPolicy.cpp.

{
  nsresult rv;
  nsCOMPtr<nsIDocShellTreeNode> rootDocShellAsNode(do_QueryInterface(aRootDocShell, &rv));
  NS_ENSURE_SUCCESS(rv, rv);

  nsCOMPtr<nsIDocShellTreeItem> childAsItem;
  rv = rootDocShellAsNode->FindChildWithName(NS_LITERAL_STRING("messagepane").get(),
                                               PR_TRUE, PR_FALSE, nsnull, nsnull, getter_AddRefs(childAsItem));
  NS_ENSURE_SUCCESS(rv, rv);
  
  nsCOMPtr<nsIWebNavigation> webNavigation (do_QueryInterface(childAsItem, &rv));
  NS_ENSURE_SUCCESS(rv, rv);
  
  return webNavigation->GetCurrentURI(aURI);
}

Here is the call graph for this function:

nsresult nsMsgContentPolicy::GetRootDocShellForContext ( nsISupports *  aRequestingContext,
nsIDocShell **  aDocShell 
) [protected]

helper routine to get the root docshell for the window requesting the load

Definition at line 532 of file nsMsgContentPolicy.cpp.

{
  NS_ENSURE_ARG_POINTER(aRequestingContext);
  nsresult rv;

  nsIDocShell *shell = NS_CP_GetDocShellFromContext(aRequestingContext);
  nsCOMPtr<nsIDocShellTreeItem> docshellTreeItem(do_QueryInterface(shell, &rv));
  NS_ENSURE_SUCCESS(rv, rv);

  nsCOMPtr<nsIDocShellTreeItem> rootItem;
  // we want the app docshell, so don't use GetSameTypeRootTreeItem
  rv = docshellTreeItem->GetRootTreeItem(getter_AddRefs(rootItem));
  NS_ENSURE_SUCCESS(rv, rv);

  return rootItem->QueryInterface(NS_GET_IID(nsIDocShell), (void**) aDocShell);
}

Here is the call graph for this function:

Definition at line 120 of file nsMsgContentPolicy.cpp.

{
  nsresult rv;

  // register ourself as an observer on the mail preference to block remote images
  nsCOMPtr<nsIPrefBranch2> prefInternal = do_GetService(NS_PREFSERVICE_CONTRACTID, &rv);
  NS_ENSURE_SUCCESS(rv, rv);

  prefInternal->AddObserver(kBlockRemoteImages, this, PR_TRUE);
  prefInternal->AddObserver(kAllowPlugins, this, PR_TRUE);

  prefInternal->GetBoolPref(kAllowPlugins, &mAllowPlugins);
  prefInternal->GetCharPref(kTrustedDomains, getter_Copies(mTrustedMailDomains));
  prefInternal->GetBoolPref(kBlockRemoteImages, &mBlockRemoteImages);
  return NS_OK;
}

Here is the call graph for this function:

PRBool nsMsgContentPolicy::IsTrustedDomain ( nsIURI aContentLocation) [protected]

Extract the host name from aContentLocation, and look it up in our list of trusted domains.

Definition at line 200 of file nsMsgContentPolicy.cpp.

{
  PRBool trustedDomain = PR_FALSE;
  // get the host name of the server hosting the remote image
  nsCAutoString host;
  nsresult rv = aContentLocation->GetHost(host);

  if (NS_SUCCEEDED(rv) && !mTrustedMailDomains.IsEmpty()) 
    trustedDomain = MsgHostDomainIsTrusted(host, mTrustedMailDomains);

  return trustedDomain;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsMsgContentPolicy::MailShouldLoad ( nsIURI aRequestingLocation,
nsIURI aContentLocation,
PRInt16 aDecision 
) [protected]

Content policy logic for mail windows.

Definition at line 399 of file nsMsgContentPolicy.cpp.

{
  NS_ENSURE_TRUE(aRequestingLocation, NS_OK);

  // Allow remote content when using a remote start page in the message pane.
  // aRequestingLocation is the url currently loaded in the message pane. 
  // If that's an http / https url (as opposed to a mail url) then we 
  // must be loading a start page and not a message.
  PRBool isHttp;
  PRBool isHttps;
  nsresult rv = aRequestingLocation->SchemeIs("http", &isHttp);
  rv |= aRequestingLocation->SchemeIs("https", &isHttps);
  if (NS_SUCCEEDED(rv) && (isHttp || isHttps))
  {
    *aDecision = nsIContentPolicy::ACCEPT;
    return NS_OK;
  }


  // (1) examine the msg hdr value for the remote content policy on this particular message to
  //     see if this particular message has special rights to bypass the remote content check
  // (2) special case RSS urls, always allow them to load remote images since the user explicitly
  //     subscribed to the feed.
  // (3) Check the personal address book and use it as a white list for senders
  //     who are allowed to send us remote images

  // get the msg hdr for the message URI we are actually loading
  nsCOMPtr<nsIMsgMessageUrl> msgUrl = do_QueryInterface(aRequestingLocation, &rv);
  NS_ENSURE_SUCCESS(rv, rv);

  nsXPIDLCString resourceURI;
  msgUrl->GetUri(getter_Copies(resourceURI));

  // get the msg service for this URI
  nsCOMPtr<nsIMsgMessageService> msgService;
  rv = GetMessageServiceFromURI(resourceURI.get(), getter_AddRefs(msgService));
  NS_ENSURE_SUCCESS(rv, rv);

  nsCOMPtr<nsIMsgDBHdr> msgHdr;
  rv = msgService->MessageURIToMsgHdr(resourceURI, getter_AddRefs(msgHdr));
  NS_ENSURE_SUCCESS(rv, rv);

  nsCOMPtr<nsIMsgMailNewsUrl> mailnewsUrl = do_QueryInterface(aRequestingLocation, &rv);
  NS_ENSURE_SUCCESS(rv, rv);

  AllowRemoteContentForMsgHdr(msgHdr, aRequestingLocation, aContentLocation, aDecision);

  if (*aDecision == nsIContentPolicy::REJECT_REQUEST)
  {
    // now we need to call out the msg sink informing it that this message has remote content
    nsCOMPtr<nsIMsgWindow> msgWindow;
    rv = mailnewsUrl->GetMsgWindow(getter_AddRefs(msgWindow)); 
    if (msgWindow)
    {
      nsCOMPtr<nsIMsgHeaderSink> msgHdrSink;
      rv = msgWindow->GetMsgHeaderSink(getter_AddRefs(msgHdrSink));
      if (msgHdrSink)
        msgHdrSink->OnMsgHasRemoteContent(msgHdr); // notify the UI to show the remote content hdr bar so the user can overide
    }
  }

  return NS_OK;
}

Here is the call graph for this function:

void nsIObserver::observe ( in nsISupports  aSubject,
in string  aTopic,
in wstring  aData 
) [inherited]

Observe will be called when there is a notification for the topic |aTopic|.

This assumes that the object implementing this interface has been registered with an observer service such as the nsIObserverService.

If you expect multiple topics/subjects, the impl is responsible for filtering.

You should not modify, add, remove, or enumerate notifications in the implemention of observe.

Parameters:
aSubject: Notification specific interface pointer.
aTopic: The notification topic or subject.
aData: Notification specific wide string. subject event.
short nsIContentPolicy::shouldLoad ( in unsigned long  aContentType,
in nsIURI  aContentLocation,
in nsIURI  aRequestOrigin,
in nsISupports  aContext,
in ACString  aMimeTypeGuess,
in nsISupports  aExtra 
) [inherited]

Should the resource at this location be loaded? ShouldLoad will be called before loading the resource at aContentLocation to determine whether to start the load at all.

Parameters:
aContentTypethe type of content being tested. This will be one one of the TYPE_* constants.
aContentLocationthe location of the content being checked; must not be null
aRequestOriginOPTIONAL. the location of the resource that initiated this load request; can be null if inapplicable
aContextOPTIONAL. the nsIDOMNode or nsIDOMWindow that initiated the request, or something that can QI to one of those; can be null if inapplicable.
aMimeTypeGuessOPTIONAL. a guess for the requested content's MIME type, based on information available to the request initiator (e.g., an OBJECT's type attribute); does not reliably reflect the actual MIME type of the requested content
aExtraan OPTIONAL argument, pass-through for non-Gecko callers to pass extra data to callees.
Returns:
ACCEPT or REJECT_*
short nsIContentPolicy::shouldProcess ( in unsigned long  aContentType,
in nsIURI  aContentLocation,
in nsIURI  aRequestOrigin,
in nsISupports  aContext,
in ACString  aMimeType,
in nsISupports  aExtra 
) [inherited]

Should the resource be processed? ShouldProcess will be called once all the information passed to it has been determined about the resource, typically after part of the resource has been loaded.

Parameters:
aContentTypethe type of content being tested. This will be one one of the TYPE_* constants.
aContentLocationOPTIONAL; the location of the resource being requested: MAY be, e.g., a post-redirection URI for the resource.
aRequestOriginOPTIONAL. the location of the resource that initiated this load request; can be null if inapplicable
aContextOPTIONAL. the nsIDOMNode or nsIDOMWindow that initiated the request, or something that can QI to one of those; can be null if inapplicable.
aMimeTypethe MIME type of the requested resource (e.g., image/png), as reported by the networking library, if available (may be empty if inappropriate for the type, e.g., TYPE_REFRESH).
aExtraan OPTIONAL argument, pass-through for non-Gecko callers to pass extra data to callees.
Returns:
ACCEPT or REJECT_*

Member Data Documentation

const short nsIContentPolicy::ACCEPT = 1 [inherited]

Returned from shouldLoad or shouldProcess if the load or process request is not rejected.

Definition at line 146 of file nsIContentPolicy.idl.

Definition at line 81 of file nsMsgContentPolicy.h.

Definition at line 80 of file nsMsgContentPolicy.h.

nsAdoptingCString nsMsgContentPolicy::mTrustedMailDomains [protected]

Definition at line 82 of file nsMsgContentPolicy.h.

const short nsIContentPolicy::REJECT_OTHER = -4 [inherited]

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.

Definition at line 140 of file nsIContentPolicy.idl.

const short nsIContentPolicy::REJECT_REQUEST = -1 [inherited]

Returned from shouldLoad or shouldProcess if the load or process request is rejected based on details of the request.

Definition at line 110 of file nsIContentPolicy.idl.

const short nsIContentPolicy::REJECT_SERVER = -3 [inherited]

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.

Definition at line 131 of file nsIContentPolicy.idl.

const short nsIContentPolicy::REJECT_TYPE = -2 [inherited]

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.

Definition at line 119 of file nsIContentPolicy.idl.

const unsigned long nsIContentPolicy::TYPE_DOCUMENT = 6 [inherited]

Indicates a document at the top-level (i.e., in a browser).

Definition at line 83 of file nsIContentPolicy.idl.

const unsigned long nsIContentPolicy::TYPE_IMAGE = 3 [inherited]

Indicates an image (e.g., IMG elements).

Definition at line 67 of file nsIContentPolicy.idl.

const unsigned long nsIContentPolicy::TYPE_OBJECT = 5 [inherited]

Indicates a generic object (plugin-handled content typically falls under this category).

Definition at line 78 of file nsIContentPolicy.idl.

const unsigned long nsIContentPolicy::TYPE_OTHER = 1 [inherited]

Definition at line 57 of file nsIContentPolicy.idl.

const unsigned long nsIContentPolicy::TYPE_REFRESH = 8 [inherited]

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.

Definition at line 101 of file nsIContentPolicy.idl.

const unsigned long nsIContentPolicy::TYPE_SCRIPT = 2 [inherited]

Indicates an executable script (such as JavaScript).

Definition at line 62 of file nsIContentPolicy.idl.

const unsigned long nsIContentPolicy::TYPE_STYLESHEET = 4 [inherited]

Indicates a stylesheet (e.g., STYLE elements).

Definition at line 72 of file nsIContentPolicy.idl.

const unsigned long nsIContentPolicy::TYPE_SUBDOCUMENT = 7 [inherited]

Indicates a document contained within another document (e.g., IFRAMEs, FRAMES, and OBJECTs).

Definition at line 89 of file nsIContentPolicy.idl.


The documentation for this class was generated from the following files: