From 6e82254d9ff0c5a6ae912d6c0d19365555229612 Mon Sep 17 00:00:00 2001 From: hoothin Date: Wed, 11 Sep 2024 19:50:29 +0800 Subject: [PATCH] Update searchJumper.user.js --- searchJumper.user.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/searchJumper.user.js b/searchJumper.user.js index 13078aac8..2591af0e5 100644 --- a/searchJumper.user.js +++ b/searchJumper.user.js @@ -13049,7 +13049,9 @@ } else { const selection = window.getSelection(); const range = selection.getRangeAt(0); - range.selectNode(element); + if (!selection.toString()) { + range.selectNode(element.childNodes === 1 ? element.firstChild : element); + } range.deleteContents(); range.insertNode(document.createTextNode(value)); selection.removeAllRanges();