Simplified IE11 upload test
This commit is contained in:
parent
dc2dc1e5a1
commit
513ddc5905
|
@ -460,21 +460,11 @@ function ulTest(done) {
|
||||||
}
|
}
|
||||||
if (ie11workaround) {
|
if (ie11workaround) {
|
||||||
// IE11 workarond: xhr.upload does not work properly, therefore we send a bunch of small 256k requests and use the onload event as progress. This is not precise, especially on fast connections
|
// IE11 workarond: xhr.upload does not work properly, therefore we send a bunch of small 256k requests and use the onload event as progress. This is not precise, especially on fast connections
|
||||||
xhr[i].onload = function() {
|
xhr[i].onload = xhr[i].onerror = function() {
|
||||||
tverb("ul stream progress event (ie11wa)");
|
tverb("ul stream progress event (ie11wa)");
|
||||||
totLoaded += reqsmall.size;
|
totLoaded += reqsmall.size;
|
||||||
testStream(i, 0);
|
testStream(i, 0);
|
||||||
};
|
};
|
||||||
xhr[i].onerror = function() {
|
|
||||||
// error, abort
|
|
||||||
tverb("ul stream failed (ie11wa)");
|
|
||||||
if (settings.xhr_ignoreErrors === 0) failed = true; //abort
|
|
||||||
try {
|
|
||||||
xhr[i].abort();
|
|
||||||
} catch (e) {}
|
|
||||||
delete xhr[i];
|
|
||||||
if (settings.xhr_ignoreErrors === 1) testStream(i, 0); //restart stream
|
|
||||||
};
|
|
||||||
xhr[i].open("POST", settings.url_ul + url_sep(settings.url_ul) + "r=" + Math.random(), true); // random string to prevent caching
|
xhr[i].open("POST", settings.url_ul + url_sep(settings.url_ul) + "r=" + Math.random(), true); // random string to prevent caching
|
||||||
xhr[i].setRequestHeader("Content-Encoding", "identity"); // disable compression (some browsers may refuse it, but data is incompressible anyway)
|
xhr[i].setRequestHeader("Content-Encoding", "identity"); // disable compression (some browsers may refuse it, but data is incompressible anyway)
|
||||||
xhr[i].send(reqsmall);
|
xhr[i].send(reqsmall);
|
||||||
|
|
2
speedtest_worker.min.js
vendored
2
speedtest_worker.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue