summaryrefslogtreecommitdiff
path: root/ext/fg
diff options
context:
space:
mode:
Diffstat (limited to 'ext/fg')
-rw-r--r--ext/fg/js/client.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/ext/fg/js/client.js b/ext/fg/js/client.js
index 56d43c3e..6b618bde 100644
--- a/ext/fg/js/client.js
+++ b/ext/fg/js/client.js
@@ -113,9 +113,11 @@ class Client {
}
showPopup(range) {
- const selection = window.getSelection();
- selection.removeAllRanges();
- selection.addRange(range);
+ if (this.options.highlightText) {
+ const selection = window.getSelection();
+ selection.removeAllRanges();
+ selection.addRange(range);
+ }
const pos = getPopupPositionForRange(this.popup, range, this.popupOffset);
@@ -130,8 +132,10 @@ class Client {
return;
}
- const selection = window.getSelection();
- selection.removeAllRanges();
+ if (this.options.highlightText) {
+ const selection = window.getSelection();
+ selection.removeAllRanges();
+ }
this.popupText = '';
this.popup.style.visibility = 'hidden';