Prehaps you are casting it to a nsIHttpChannel first?

// don't want to do this
nsCOMPtr< nsIHttpChannel > httpChannel = do_QueryInterface( request );


NS_IMETHODIMP Browser::OnStateChange( nsIWebProgress* progress, nsIRequest* request,
PRUint32 progressStateFlags, nsresult status )
{
nsCOMPtr<nsIURI> aURL;
nsCOMPtr<nsIChannel> aChannel = do_QueryInterface( request );
if (aChannel)
{
result = aChannel->GetOriginalURI(getter_AddRefs(aURL));
if (NS_SUCCEEDED(result))
{
nsEmbedCString str;
aURL->GetScheme(str);
if (str.Equals("file"))
{
// loading local file just fine.
}
}
}

Steve

Babele Dunnit wrote:
Hi,

I just discovered that, when clicking on an already-navigated link on
a local (i.e. file://) URI, OnStateChange callback is never called,
and onLocationChange request is always NULL. Is this a bug? Or is this
behaviour related to reading from cache an already clicked link? I
have some important initialization and finalization code in
OnStateChange and it is never called...

_______________________________________________
dev-embedding mailing list
dev-embedding@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-embedding


_______________________________________________
dev-embedding mailing list
dev-embedding@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-embedding

Reply via email to