diff --git a/shell/src/main/resources/html/js/index.js b/shell/src/main/resources/html/js/index.js
index f9cc7b7c785..a1a96b8ad78 100644
--- a/shell/src/main/resources/html/js/index.js
+++ b/shell/src/main/resources/html/js/index.js
@@ -113,12 +113,8 @@ function setupHterm() {
}
function getParams(key) {
- var reg = new RegExp("(^|&)" + key + "=([^&]*)(&|$)");
- var r = location.search.substr(1).match(reg);
- if (r != null) {
- return unescape(r[2]);
- }
- return null;
+ var params = new URLSearchParams(location.search);
+ return params.get(key);
};
// This will be whatever normal entry/initialization point your project uses.