From a8af6ba700e49db63c197527dfb4e26086c10f42 Mon Sep 17 00:00:00 2001 From: dosse91 Date: Sat, 24 Oct 2020 09:32:39 +0200 Subject: [PATCH] Improved settings behavior --- speedtest.js | 4 ++-- speedtest_worker.js | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/speedtest.js b/speedtest.js index 6b77f72..48d47d8 100644 --- a/speedtest.js +++ b/speedtest.js @@ -69,8 +69,8 @@ Speedtest.prototype = { * Invalid values or nonexistant parameters will be ignored by the speedtest worker. */ setParameter: function(parameter, value) { - if (this._state != 0 && this._state != 4) - throw "You cannot change the test settings after adding server or starting the test"; + if (this._state == 3) + throw "You cannot change the test settings while running the test"; this._settings[parameter] = value; if(parameter === "telemetry_extra"){ this._originalExtra=this._settings.telemetry_extra; diff --git a/speedtest_worker.js b/speedtest_worker.js index 3ff26d6..2899e70 100644 --- a/speedtest_worker.js +++ b/speedtest_worker.js @@ -64,7 +64,8 @@ var settings = { useMebibits: false, //if set to true, speed will be reported in mebibits/s instead of megabits/s telemetry_level: 0, // 0=disabled, 1=basic (results only), 2=full (results and timing) 3=debug (results+log) url_telemetry: "results/telemetry.php", // path to the script that adds telemetry data to the database - telemetry_extra: "" //extra data that can be passed to the telemetry through the settings + telemetry_extra: "", //extra data that can be passed to the telemetry through the settings + forceIE11Workaround: false //when set to true, it will foce the IE11 upload test on all browsers. Debug only }; var xhr = null; // array of currently active xhr requests