From 5d0ec2276c229b1aac5437b1ca9fb48dbd0e9aee Mon Sep 17 00:00:00 2001 From: olavivaino Date: Thu, 17 Aug 2023 15:06:39 +0300 Subject: [PATCH] Added 'loadend' event listener Added 'loadend' event listener to xhr. Why is this needed? Appears that in Firefox ver 109.0.1 xhr does not always fire event 'load'. But does fire 'loadend'. Problem was discovered while debugging old Angular 1 application. It is not reproducible in plain playground environment. --- src/flow.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/flow.js b/src/flow.js index 1b016c0e..8e1b09b7 100644 --- a/src/flow.js +++ b/src/flow.js @@ -1393,6 +1393,7 @@ this.xhr = new XMLHttpRequest(); this.xhr.upload.addEventListener('progress', this.progressHandler, false); this.xhr.addEventListener("load", this.doneHandler, false); + this.xhr.addEventListener("loadend", this.doneHandler, false); this.xhr.addEventListener("error", this.doneHandler, false); var uploadMethod = evalOpts(this.flowObj.opts.uploadMethod, this.fileObj, this);