From f91e77b4d2899b8684dbc3071138478ca970cbbe Mon Sep 17 00:00:00 2001 From: kimyenac Date: Mon, 13 Jul 2026 16:38:12 +0900 Subject: [PATCH] [ZEPPELIN-6495] Use URLSearchParams in terminal getParams helper Replace the hand-rolled location.search.substr(1).match(...) parser and the deprecated unescape(...) call in the %sh.terminal frontend helper with the standard URLSearchParams API. URLSearchParams.get(key) returns null for missing keys, preserving the existing behavior for the noteId/paragraphId parameters consumed by the terminal page, while relying on standard URL decoding instead of the deprecated global unescape. Co-Authored-By: Claude Opus 4.8 (1M context) --- shell/src/main/resources/html/js/index.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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.