From 2c5bf0ed6b2345fb8aa302a38f73cd452df8c254 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Fri, 10 Apr 2020 17:11:41 -0400 Subject: Fix getSelection not working in QueryParser --- ext/mixed/js/text-scanner.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext') diff --git a/ext/mixed/js/text-scanner.js b/ext/mixed/js/text-scanner.js index b8156c01..9d8a7f0c 100644 --- a/ext/mixed/js/text-scanner.js +++ b/ext/mixed/js/text-scanner.js @@ -134,7 +134,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; } -- cgit v1.2.3 From f88d4b02e4457e321a0bce1a4b67d0c355f7e1a3 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sat, 11 Apr 2020 15:56:08 -0400 Subject: Use window.getSelection instead of document.getSelection --- ext/bg/js/search.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext') diff --git a/ext/bg/js/search.js b/ext/bg/js/search.js index 9250fdde..5d04c6e4 100644 --- a/ext/bg/js/search.js +++ b/ext/bg/js/search.js @@ -209,7 +209,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}) { -- cgit v1.2.3