Plugin is not able to get notified about 'http-on-modify-request' (c++)
ideas Tank <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.xpfe |
|---|---|
| Organization | http://groups.google.com |
| Message-ID | <401ac6b1-b05d-48c3-97bc-e282d5013283@pz2g2000pbc.googlegroups.com> |
Hi All,
I am writing a sample plugin which will get notified whenever http
request is made. Below is a information about the environment-
Programming language - C++
Gecko / XUL runner - 10.0.2
Firefox - 10.0.2
OS: Windows Vista.
Below is how plugin registers for 'http-on-modify-request'-
nsresult rv;
nsCOMPtr<nsIObserverService> observerService =
do_GetService("@mozilla.org/observer-service;1", &rv);
if(NS_FAILED(rv))
{
return false;
}
rv = observerService->AddObserver(m_ptrEventHandler, "http-on-
modify-request", false);
if(NS_FAILED(rv))
{
return false;
}
This is how I am handling observer
EventHandler.h
class CEventsHandler : public nsIObserver
{
NS_DECL_ISUPPORTS
NS_DECL_NSIOBSERVER
CBrowserEventsHandler()
{
}
}
EventHandler.cpp
NS_IMPL_ISUPPORTS1(CBrowserEventsHandler, nsIObserver)
NS_IMETHODIMP CEventsHandler::Observe(nsISupports *aSubject, const
char * aTopic, const PRUnichar * aData)
{
//Handling observers
return NS_OK;
}
Please let me know if more information is needed.
Any help / sample code / pointers would be a great help.
Thanks and regards,
Umesh