I am trying to write a componant which will be used to block sites. I
derived my componant from nsIContentPolicy Interface and registerd the
"content-policy" category during the registration process. It should
call ShouldLoad function of nsIContentPolicy when I visit a web site
but it is not doing so.
This is done in the registration function
nsCOMPtr<nsICategoryManager> catman;
rv =
servman->GetServiceByContractID(NS_CATEGORYMANAGER_CONTRACTID,NS_GET_IID(nsICategoryManager),
getter_AddRefs(catman));
rv = catman->AddCategoryEntry("xpcom-startup","WebLock",
WebLock_ContractID,PR_TRUE,PR_TRUE,&previous);
rv = catman->AddCategoryEntry("content-policy","WebLock",
WebLock_ContractID,PR_TRUE,PR_TRUE,&previous);
and then I have ShouldLoad function. but it never gets executed.
any ideas why it does not work?
It however works for the "xpcom-startup" category and I am getting the
notifications when I start the browser.
I am using netscape 7.1 which is build on Mozilla 1.4