diff --git a/client/js/socket-events/configuration.js b/client/js/socket-events/configuration.js index e2674b9a..3465cdb3 100644 --- a/client/js/socket-events/configuration.js +++ b/client/js/socket-events/configuration.js @@ -1,7 +1,6 @@ "use strict"; const $ = require("jquery"); -const URI = require("urijs"); const socket = require("../socket"); const templates = require("../../views"); const options = require("../options"); @@ -86,10 +85,10 @@ socket.on("configuration", function(data) { }); }); - if ($(document.body).hasClass("public")) { - const params = URI(document.location.search).search(true); + if ($(document.body).hasClass("public") && "URLSearchParams" in window) { + const params = new URLSearchParams(document.location.search); - for (let key in params) { + for (let [key, value] of params) { // Support `channels` as a compatibility alias with other clients if (key === "channels") { key = "join"; @@ -99,8 +98,6 @@ socket.on("configuration", function(data) { continue; } - let value = params[key]; - if (key === "join") { value = value.split(",").map((chan) => { if (!chan.match(/^[#&!+]/)) {