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)
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.
Comment 3•14 years ago
|
||
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?
Comment 5•14 years ago
|
||
(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.
Updated•14 years ago
|
Version: unspecified → 3.6 Branch
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•