work on prompt() solution

This commit is contained in:
Kevin F 2021-10-11 23:56:11 +00:00
parent fc96e8daee
commit 9afe3ac2ab
3 changed files with 57 additions and 4 deletions

View File

@ -36,8 +36,8 @@ Development Roadmap:
Sources:
https://www.keytrac.net/en/
https://www.typingdna.com/
www dot keytrac dot net/en/
www dot typingdna dot com/
https://www.whonix.org/wiki/Stylometry
[https://www.whonix.org/wiki/Keystroke_Deanonymization](https://www.whonix.org/wiki/Keystroke_Deanonymization)

View File

@ -21,8 +21,47 @@ const defaultHosts = "<all_urls>";
let appCode = function (){
let minValue = 75
let maxValue = 150
let time = 0
let last = null
let doPopup = function(e) {
let text = ""
let inputType = ""
if (e.target.tagName === "INPUT"){
inputType = e.target.getAttribute("type")
if (Date.now() - time < 1000 && e.target === last){
return
}
if (! inputType){
text = prompt("[PrivateKeyboard]\n\nEnter text for the text field:", e.target.value)
}
else if (! ["text", "search", "email", "password", "number"].includes(inputType.toLowerCase())){
return
}
else{
if (inputType == "password"){
inputType = "password (SHOWN IN PLAIN TEXT)"
}
text = prompt("[PrivateKeyboard]\n\nEnter text for the " + inputType + " field:", e.target.value)
}
e.target.value = text
last = e.target
time = Date.now()
}
}
let popupMode = function(){
document.addEventListener('focusin', doPopup, true)
}
let mainKeyboardPrivacy = function(){
popupMode()
function getRandNum(){
let buf = new Uint8Array(1)
@ -63,9 +102,23 @@ let appCode = function (){
}, )
document.addEventListener('keydown', function(e){
if (e.key.startsWith('Arrow') || e.key.startsWith('Page')){
if (e.key.startsWith('Arrow') || e.key.startsWith('Page') ||
e.key == "Enter" || e.key == "Control" || e.key == "Tab"
){
return true;
}
else if (e.key.length > 1 && e.key.startsWith("F")){
// Ignore function keys (unicode can also be >1 length so check for f)
return true;
}
else{
console.debug(e.key)
}
setTimeout(
function(){doPopup(e)}, 10)
pausecomp(down);
return true;
})

View File

@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "Private Keyboard",
"version": "1.8",
"version": "1.9",
"description": "Protect against keyboard biometrics",