Open Bug 574069 Opened 15 years ago Updated 8 months ago

Image requests handled during a click event handler are aborted on page exit

Categories

(Firefox :: General, defect)

3.6 Branch
x86
Windows 7
defect

Tracking

()

UNCONFIRMED

People

(Reporter: jeff.jobe, Unassigned)

Details

Attachments

(2 files)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 Images that are requested as part of a dynamically bound "click" event are usually truncated as the browser honors the target of the click event. The host of the image being requested exists somewhere other than the host server so response times vary, thus results may vary too. The hit gets truncated at a time somewhere after the syn/ack portion of the IP conversation. The communication always starts, but gets clipped somewhere after syn/ack. Reproducible: Sometimes Steps to Reproduce: 1. Build a simple web page with the following JavaScript: function dcsBind(event,func){ if ((typeof(window[func])=="function")&&document.body){ if (document.body.addEventListener) { document.body.addEventListener(event, window[func], true); } else if(document.body.attachEvent) { document.body.attachEvent("on"+event, window[func]); } } } function makeCall() { var imgsrc="http://statse.webtrendslive.com/dcs1234567890/dcs.gif?dcsuri=/firefoxtest"; var img = new Image(); img.src= imgsrc; } dcsBind("click", "makeCall"); 2. Put an anchor tag to anywhere on the page. 3. Load a monitoring tool such as HTTPFox. Not sure if firebug shows the problem. 3. Host the page and click the link. (If the problem doesn't appear you may have to artificially inflate the response times. I use Fiddler to build in a 200-300 ms lag). You may also have to clear your cache after an attempt. Actual Results: Big red error in HTTPFox "NS_IMAGELIB_ERROR_FAILURE". Expected Results: 200 return code. The purpose of the image request is to log events in the UI such as button presses or other custom "onclick" events. This behavior makes that kind of tracking unreliable. Please contact me with any additional questions. I am happy to provide screenshots and movies showing the error.
Hmm, I wonder if this is expected behavior as the browser is leaving the page and anything after a click can't be guaranteed. I also wonder if utilizing the onbeforeunload event would provide a more resilient solution.
An interesting idea, but that wouldn't give us access to the target of the click event, would it?
(In reply to comment #4) > An interesting idea, but that wouldn't give us access to the target of the > click event, would it? Ah, I think you are correct.
Version: unspecified → 3.6 Branch
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: