Skip to content

Commit

Permalink
Update searchJumper.user.js
Browse files Browse the repository at this point in the history
  • Loading branch information
hoothin committed Sep 11, 2024
1 parent a268853 commit 6e82254
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion searchJumper.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 6e82254

Please sign in to comment.