From 024f969bfd884e43cd40f408d0e3ba32839be45f Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sun, 15 Dec 2019 13:27:26 -0500 Subject: Update comment on getClipboardText --- ext/bg/js/search.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ext/bg/js/search.js b/ext/bg/js/search.js index de2bca64..cbfce6a5 100644 --- a/ext/bg/js/search.js +++ b/ext/bg/js/search.js @@ -286,8 +286,10 @@ class DisplaySearch extends Display { async getClipboardText() { /* Notes: - apiClipboardGet doesn't work on firefox because document.execCommand('paste') requires - user interaction. Therefore, navigator.clipboard.readText() is used. + apiClipboardGet doesn't work on Firefox because document.execCommand('paste') + results in an empty string on the web extension background page. + This may be a bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1603985 + Therefore, navigator.clipboard.readText() is used on Firefox. navigator.clipboard.readText() can't be used in Chrome for two reasons: * Requires page to be focused, else it rejects with an exception. -- cgit v1.2.3