When an HTML file uses a Script tag with a src attribute that includes a query string to load a JavaScript program, you cannot use location.search to retrieve the query string, because location does not contain the URL (as it does with the href attribute). The URL can be obtained using "new URL(here.src).search", where "here" is a string you use in the Script id attribute.
Thus, one solution (from another answer elsewhere, that does not decode the arguments) is
var queryDict = {};
new URL(here.src).search.substr(1).split("&").forEach(function(item) {queryDict[item.split("=")[0]] = item.split("=")[1]})
After running this code, queryDict is an object containing the argument property/value pairs.