hello, I face a problem about cancel the network request on gecko's
example winembed, my code is as below.
but this code didn't work well.
I found that the browser is still waitting for the network connection
event to complete the Page Load process.
I'm looking forward for your help, thanks very much !!!!
NS_IMETHODIMP WebBrowserChrome::OnStateChange(nsIWebProgress
*progress, nsIRequest *request,
PRUint32
progressStateFlags, nsresult status)
{
if ((progressStateFlags & STATE_START) && (progressStateFlags &
STATE_IS_REQUEST))
{
nsCAutoString RqName;
if( NS_SUCCEEDED(request->GetName(RqName)) )
{
char* pRqName = new char[ RqName.Length()+1];
sprintf(pRqName,"%s",RqName.get());
// cancel the request to connet to the internet
if( _strnicmp(pRqName,"http://",7)==0 )
{
request->Cancel(NS_BINDING_ABORTED);
printf("Cancel the request %s\n", pRqName);
}
return NS_OK;
}
--
thanks
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding