Closed Bug 342196 Opened 18 years ago Closed 18 years ago

ordering bug causes some urls to not be inspected on new windows

Categories

(Toolkit :: Safe Browsing, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 2 beta1

People

(Reporter: tony, Assigned: tony)

Details

(Keywords: fixed1.8.1, Whiteboard: swag:1day)

Attachments

(1 file)

To avoid Ts regressions, the JS code for safebrowsing is loaded a couple seconds after Chrome window load.  This could cause some URLs (like the URL opening the browser window) to be missed, so once safebrowsing code loads, we check all the tabs and iframes for phishing urls.

Unfortunately, this misses urls that have already started, but data hasn't begun transfering (url isn't set until the request fires ondataavailable).
There's a straightforward fix.  I should have a patch by the end of the day.
Status: NEW → ASSIGNED
Flags: blocking-firefox2?
Whiteboard: swag:1day
Target Milestone: --- → Firefox 2 beta1
Setup the webprogresslistener immediately and just collect requests/urls in an array.  Once the js code loads, check the requests in the array.
Attachment #226430 - Flags: review?(mmchew)
Attachment #226430 - Flags: approval1.8.1?
Comment on attachment 226430 [details] [diff] [review]
v1: setup the webprogresslistener immediately (before js load)

Looks fine.

>Index: browser/components/safebrowsing/content/sb-loader.js
>===================================================================
>--- browser/components/safebrowsing/content/sb-loader.js	old
>+++ browser/components/safebrowsing/content/sb-loader.js	new
>@@ -39,33 +39,48 @@
>  * This file is included into the main browser chrome from
>  * browser/base/content/global-scripts.inc
>  */
> 
> var safebrowsing = {
>   controller: null,
>   phishWarden: null,
> 
>+  // We set up the web progress listener immediately so we don't miss any
>+  // phishing urls.  Since the phishing infrastructure isn't loaded yet, we
>+  // just store the urls in a list.
>+  progressListener: null,
>+  progressListenerCallback: {
>+    requests: [],
>+    onDocNavStart: function(request, url) {
>+      this.requests.push({
>+        'request': request,
>+        'url': url
>+      });
>+    }
>+  },
Check requests is non-null here in case of spurious onDocNavStart events that get triggered after deferred start cleanup?
Attachment #226430 - Flags: review?(mmchew) → review+
on trunk
Comment on attachment 226430 [details] [diff] [review]
v1: setup the webprogresslistener immediately (before js load)

browser/ changes require at least a browser peer or owner to review the changes.  Over to mconnor, but you could also try to get review from ben.

Please re-request branch approval once you have sr from a browser/ reviewer.
Attachment #226430 - Flags: approval1.8.1? → superreview?(mconnor)
Comment on attachment 226430 [details] [diff] [review]
v1: setup the webprogresslistener immediately (before js load)

sr=ben@mozilla.org
Attachment #226430 - Flags: superreview?(mconnor) → superreview+
Attachment #226430 - Flags: approval1.8.1?
Comment on attachment 226430 [details] [diff] [review]
v1: setup the webprogresslistener immediately (before js load)

a=darin on behalf of drivers (please land on the MOZILLA_1_8_BRANCH and add the fixed1.8.1 keyword to the bug)
Attachment #226430 - Flags: approval1.8.1? → approval1.8.1+
Flags: blocking-firefox2? → blocking-firefox2+
on branch
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Keywords: fixed1.8.1
Resolution: --- → FIXED
Product: Firefox → Toolkit
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: