From b84a28f06204b06d52faf625172994596e9c418c Mon Sep 17 00:00:00 2001 From: Kevin F Date: Tue, 12 Oct 2021 07:34:19 +0000 Subject: [PATCH] work on prompt() solution --- background.js | 13 ++++++++++++- settings/options.html | 3 +++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/background.js b/background.js index eee9895..b737499 100644 --- a/background.js +++ b/background.js @@ -19,6 +19,14 @@ const defaultHosts = ""; let appCode = function (){ + let clearSelect = function() + { + if (window.getSelection) {window.getSelection().removeAllRanges()} + else if + (document.selection) { + document.selection.empty() + } + } let minValue = 75 let maxValue = 150 let time = 0 @@ -46,8 +54,11 @@ let appCode = function (){ } text = prompt("[PrivateKeyboard]\n\nEnter text for the " + inputType + " field:", e.target.value) } - e.target.value = text + if (text !== null) { + e.target.value = text + } last = e.target + clearSelect() time = Date.now() } diff --git a/settings/options.html b/settings/options.html index 41d76a1..b5efcbe 100644 --- a/settings/options.html +++ b/settings/options.html @@ -9,6 +9,9 @@
+ + +

Trusted domains (comma delimited)