parseQueryString: switch to URLSearchParams and remove unused param (#3340)

This commit is contained in:
Dominik
2025-03-27 13:29:44 +01:00
committed by GitHub

View File

@@ -530,16 +530,9 @@ function getCSSval(cssclass, cssproperty) {
return val; return val;
} }
function parseQueryString(queryString = globalThis.location.search) { function parseQueryString() {
const GETDict = {}; const params = new URLSearchParams(globalThis.location.search);
queryString return Object.fromEntries(params.entries());
.substr(1)
.split("&")
.forEach(function (item) {
GETDict[item.split("=")[0]] = decodeURIComponent(item.split("=")[1]);
});
return GETDict;
} }
// https://stackoverflow.com/q/21647928 // https://stackoverflow.com/q/21647928