Improved settings behavior

This commit is contained in:
dosse91 2020-10-24 09:32:39 +02:00
parent c6a36e68c4
commit a8af6ba700
2 changed files with 4 additions and 3 deletions

View file

@ -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;

View file

@ -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