From 56b89b01fe2d9985aef4742e8a7d0864e15de230 Mon Sep 17 00:00:00 2001 From: "tony%ponderer.org" Date: Wed, 26 Jul 2006 17:41:36 +0000 Subject: [PATCH] Bug 345938: anti-phishing doesn't check all urls if there are http redirects patch: listen for all document requests r=darin,sr=bryner --- .../src/nsDocNavStartProgressListener.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/browser/components/safebrowsing/src/nsDocNavStartProgressListener.cpp b/browser/components/safebrowsing/src/nsDocNavStartProgressListener.cpp index 3b01e3eb6b9..03142b0cbb2 100644 --- a/browser/components/safebrowsing/src/nsDocNavStartProgressListener.cpp +++ b/browser/components/safebrowsing/src/nsDocNavStartProgressListener.cpp @@ -86,7 +86,7 @@ nsDocNavStartProgressListener::AttachListeners() NS_ENSURE_SUCCESS(rv, rv); return webProgressService->AddProgressListener(this, - nsIWebProgress::NOTIFY_STATE_DOCUMENT); + nsIWebProgress::NOTIFY_STATE_REQUEST); } @@ -210,14 +210,14 @@ nsDocNavStartProgressListener::OnStateChange(nsIWebProgress *aWebProgress, nsresult aStatus) { if (mEnabled && aStateFlags & STATE_START && aStateFlags & STATE_IS_REQUEST) { - // might be for us, check load flags + // We only care about document loads, check load flags. nsresult rv; -#ifdef DEBUG nsLoadFlags loadFlags; rv = aRequest->GetLoadFlags(&loadFlags); - NS_ASSERTION(NS_SUCCEEDED(rv) && loadFlags & nsIChannel::LOAD_DOCUMENT_URI, - "Unexpected load flags, we only registered for loads"); -#endif + NS_ENSURE_SUCCESS(rv, rv); + if (!(loadFlags & nsIChannel::LOAD_DOCUMENT_URI)) + return NS_OK; + // ignore requests with no URI nsCOMPtr uri; rv = GetRequestUri(aRequest, getter_AddRefs(uri));