From 3b29ae64ec85be6cdeed8f12f620f3cea136d202 Mon Sep 17 00:00:00 2001 From: Dave Lamb Date: Thu, 9 Jan 2020 14:18:21 +0100 Subject: [PATCH] Focus was being cleared via selection.empty() since clearHighlight didn't early-exit on first run, due to selText being undefined, rather than null. Coerce selText to boolean to catch this case. --- content.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content.js b/content.js index 4eadb40..2cf5888 100644 --- a/content.js +++ b/content.js @@ -743,7 +743,7 @@ function highlightMatch(doc, rangeStartNode, rangeStartOffset, matchLen, selEndL function clearHighlight() { - if (selText === null) { + if (!selText) { return; }