summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-04-12 11:42:56 -0400
committerGitHub <noreply@github.com>2020-04-12 11:42:56 -0400
commit778d49f86b9652ac03d550dd7c26ffdba5b49047 (patch)
treecc907f4e81264c99e12149568a4ed8d8097dd48c
parent649adb13d8e1a775bb54e28b12401f7f95c5ab8d (diff)
parentf88d4b02e4457e321a0bce1a4b67d0c355f7e1a3 (diff)
Merge pull request #443 from toasted-nutbread/fix-get-selection
Fix getSelection not working in QueryParser
-rw-r--r--ext/bg/js/search.js2
-rw-r--r--ext/mixed/js/text-scanner.js2
2 files changed, 2 insertions, 2 deletions
diff --git a/ext/bg/js/search.js b/ext/bg/js/search.js
index 2ba3e468..871c576b 100644
--- a/ext/bg/js/search.js
+++ b/ext/bg/js/search.js
@@ -208,7 +208,7 @@ class DisplaySearch extends Display {
onCopy() {
// ignore copy from search page
- this.clipboardMonitor.setPreviousText(document.getSelection().toString().trim());
+ this.clipboardMonitor.setPreviousText(window.getSelection().toString().trim());
}
onExternalSearchUpdate({text}) {
diff --git a/ext/mixed/js/text-scanner.js b/ext/mixed/js/text-scanner.js
index a1d96320..e6b9a2e6 100644
--- a/ext/mixed/js/text-scanner.js
+++ b/ext/mixed/js/text-scanner.js
@@ -133,7 +133,7 @@ class TextScanner {
this.preventNextClick = false;
const primaryTouch = e.changedTouches[0];
- if (DOM.isPointInSelection(primaryTouch.clientX, primaryTouch.clientY, this.node.getSelection())) {
+ if (DOM.isPointInSelection(primaryTouch.clientX, primaryTouch.clientY, window.getSelection())) {
return;
}