Bug 31126: Use URLSearchParams instead of Query.parse.

This standard interface does the same thing as Query.parse did, with a
different API on the return value. It doesn't have the problems with
keys inherited from Object.prototype that Query.parse did.
This commit is contained in:
David Fifield 2019-07-18 15:41:16 -06:00
parent 76b81bcf77
commit fdc5563f87
4 changed files with 11 additions and 117 deletions

View file

@ -1,4 +1,4 @@
/* global TESTING, Util, Query, Params, Config, DebugUI, BadgeUI, UI, Broker, Snowflake */
/* global TESTING, Util, Params, Config, DebugUI, BadgeUI, UI, Broker, Snowflake */
/*
Entry point.
@ -15,7 +15,7 @@ var snowflake, query, debug, silenceNotifications, log, dbg, init;
snowflake = null;
query = Query.parse(location.search.substr(1));
query = new URLSearchParams(location.search);
debug = Params.getBool(query, 'debug', false);
@ -38,7 +38,7 @@ var snowflake, query, debug, silenceNotifications, log, dbg, init;
init = function() {
var broker, config, ui;
config = new Config;
if ('off' !== query['ratelimit']) {
if ('off' !== query.get('ratelimit')) {
config.rateLimitBytes = Params.getByteCount(query, 'ratelimit', config.rateLimitBytes);
}
ui = null;