my question is about the use of the nsIContentPolicy interface

I would like my component (singleton) to be notified before a page is loading. So i added nsIContentPolicy interface like that :

class MON_COMPONENT : public IMON_COMPONENT, public nsIContentPolicy
...

NS_IMPL_ISUPPORTS2(MON_COMPONENT, IMON_COMPONENT, nsIContentPolicy)
...

and implmented the two methods :
NS_IMETHODIMP WWindows::ShouldLoad()
NS_IMETHODIMP WWindows::ShouldProcess()

both with those parameters
PRUint32 aContentType,
nsIURI *aContentLocation,
nsIURI *aRequestOrigin,
nsISupports *aContext,
const nsACString & aMimeTypeGuess,
nsISupports *aExtra,
PRInt16 *_retval)

in those methods, i just added a log line to see when they are called :
Log("Methode ShouldLoad", __LINE__, __FILE__);

when registering my component, i add he new entry in the content-policy category :
...


Log("Adding category entry", __LINE__, __FILE__);
   rv = catman->AddCategoryEntry("content-policy",
                                 "MON_COMPONENT",
                                 WWINDOWS_CONTRACTID,
                                 PR_TRUE,
                                 PR_TRUE,
                                 &previous);
...

Here is my problem : in the logs i see that the new entry is added in firefox but howewer the ShouldLoad and ShouldProcess are not called when i load new web pages.

So what's wrong ? do have i forgotten something ?

Thanks in advance for your help.
_______________________________________________
Mozilla-xpcom mailing list
[email protected]
http://mail.mozilla.org/listinfo/mozilla-xpcom

Reply via email to