diff options
author | siikamiika <siikamiika@users.noreply.github.com> | 2019-10-27 15:46:27 +0200 |
---|---|---|
committer | siikamiika <siikamiika@users.noreply.github.com> | 2019-10-27 15:46:27 +0200 |
commit | 48776145d6bdb8aff82e82546583c790353e75b6 (patch) | |
tree | 738b1557aa7362948b7c52e8673fc514858a53a0 /ext/bg/js/api.js | |
parent | d3f51690f8bb236d1ba3c79c20b3a60d3e62dc52 (diff) |
add workaround to Chrome clipboard.readText
For some reason this doesn't work on Firefox, so keep using the new API
for Firefox
Diffstat (limited to 'ext/bg/js/api.js')
-rw-r--r-- | ext/bg/js/api.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ext/bg/js/api.js b/ext/bg/js/api.js index 999ea337..88eef431 100644 --- a/ext/bg/js/api.js +++ b/ext/bg/js/api.js @@ -401,3 +401,11 @@ async function apiFocusTab(tab) { // Edge throws exception for no reason here. } } + +async function apiClipboardGet() { + const clipboardPasteTarget = utilBackend().clipboardPasteTarget; + clipboardPasteTarget.innerText = ''; + clipboardPasteTarget.focus(); + document.execCommand('paste'); + return clipboardPasteTarget.innerText; +} |