Cleanup and lower timing delay

This commit is contained in:
Kevin F 2022-02-20 18:17:10 -06:00
parent e39251cafc
commit 922a0bdbd1
3 changed files with 9 additions and 9 deletions

View File

@ -36,8 +36,8 @@ let appCode = function (){
document.selection.empty()
}
}
let minValue = 75
let maxValue = 150
let minValue = 50
let maxValue = 75
let time = 0
let last = null
@ -100,9 +100,8 @@ let appCode = function (){
function pausecomp(millis)
{
// Yes i know this wastes cpu. i don't like it either, but it seems a blocking
// approach is needed to prevent spying event listeners from reading key events in *real time*
// Might use an off-page buffer solution in the future
// Yes i know this wastes cpu. i don't like it either, but it is the only way
// i know of to have real page keypress events that aren't trackable
var date = new Date();
var curDate = null;
do { curDate = new Date(); }

View File

@ -9,9 +9,10 @@
</head>
<body>
<header id="siteDomain"></header>
<button id="toggleSite">Disable Keyboard Privacy</button>
<button id="toggleSite">Disable Slow Typing</button>
<p id="reloadPage">Refresh the page to apply</p>
<br>
<br>
<textarea tabindex="0" id="keyBuffer" cols="20" rows="10" placeholder="Text typed here will be sent to active input/textarea elements. Breaks on many sites, but is faster than typing directly on the page"></textarea>
</body>

View File

@ -33,7 +33,7 @@ browser.storage.sync.get("keyboardprivacywhitelist")
let hostname = extractHostname(tabVal[0].url).replace('www.', '')
document.getElementById('siteDomain').innerText = hostname
if (val.keyboardprivacywhitelist.includes(hostname)) {
document.getElementById('toggleSite').innerText = 'Enable Keyboard Privacy'
document.getElementById('toggleSite').innerText = 'Enable Slow Typing'
}
})
.catch(reportError);
@ -104,11 +104,11 @@ document.getElementById('toggleSite').onclick = async function(){
}
document.getElementById('toggleSite').setAttribute('disabled', true)
if (document.getElementById('toggleSite').innerText.startsWith('Disable')){
document.getElementById('toggleSite').innerText = 'Enable Keyboard Privacy'
document.getElementById('toggleSite').innerText = 'Enable Slow Typing'
changeWhitelist(document.getElementById('siteDomain').innerText, true)
}
else if (document.getElementById('toggleSite').innerText.startsWith('Enable')){
document.getElementById('toggleSite').innerText = 'Disable Keyboard Privacy'
document.getElementById('toggleSite').innerText = 'Disable Slow Typing'
changeWhitelist(document.getElementById('siteDomain').innerText, false)
}
setTimeout(function(){fixDuplicateCommas()}, 1000)