aboutsummaryrefslogtreecommitdiff
path: root/ext/js/language/text-scanner.js
diff options
context:
space:
mode:
authorDarius Jahandarie <djahandarie@gmail.com>2023-08-19 18:38:34 +0900
committerGitHub <noreply@github.com>2023-08-19 18:38:34 +0900
commita00a56c429347d872bfd6fe1597e6f8991cf7217 (patch)
treeec0342d9c48382b3457df0cfa4bfa5b485980f40 /ext/js/language/text-scanner.js
parenta59d0c8db30e852c901dfd1f35187ec2395bf464 (diff)
parent07333a2807fc23875a3ffa34f97ea0ff1e44d3d6 (diff)
Merge pull request #209 from praschke/firefox-fixes
Firefox fixes
Diffstat (limited to 'ext/js/language/text-scanner.js')
-rw-r--r--ext/js/language/text-scanner.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/js/language/text-scanner.js b/ext/js/language/text-scanner.js
index 6fa7a454..af5cc8fe 100644
--- a/ext/js/language/text-scanner.js
+++ b/ext/js/language/text-scanner.js
@@ -145,7 +145,8 @@ class TextScanner extends EventDispatcher {
if (value) {
this._hookEvents();
- this._userHasNotSelectedAnythingManually = window.getSelection().isCollapsed;
+ const selection = window.getSelection();
+ this._userHasNotSelectedAnythingManually = (selection === null) ? true : selection.isCollapsed;
}
}