diff --git a/README.md b/README.md index 5897f48..83df6a3 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,14 @@ The easiest is to simply type on a page as normal. This method breaks the least You can whitelist sites by using the button in the addon's popup or by manually adding them on the addon settings page. +## Unicode Conversion + +There is a default disabled setting to convert ascii to look-alike unicode characters. + +This doesn't do a lot, but it makes it a bit harder to do 'sentiment-analysis' and breaks typical text search. + +This can also circumvent naive profanity filters. + ## Toolbar input You can also enter text into the textarea in the toolbar button which will be instantly transfered to the page. This method allows you to type without lag, but it breaks on many websites and can still be tracked if a website is checking input changes as opposed to key events. diff --git a/manifest.json b/manifest.json index f2e61ee..51a6d09 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 2, "name": "Private Keyboard", - "version": "2.0", + "version": "2.1", "description": "Protect against keyboard biometrics", diff --git a/settings/button.html b/settings/button.html index 9edbce6..e22a9d2 100644 --- a/settings/button.html +++ b/settings/button.html @@ -4,6 +4,7 @@ Private Keyboard + diff --git a/settings/keybuffer2.js b/settings/keybuffer2.js index 78e0abd..a9a9fe7 100644 --- a/settings/keybuffer2.js +++ b/settings/keybuffer2.js @@ -1,5 +1,17 @@ let started = false +useUnicode = false + +let usingUnicode = function(result){ + console.debug(result) + if (result['keyboardprivacyunicode']){ + useUnicode = true + } +} + +let doUnicode = browser.storage.sync.get("keyboardprivacyunicode"); +doUnicode.then(usingUnicode, onError); + function onError(error) { console.error(`Error: ${error}`); } @@ -35,7 +47,12 @@ let sender = async function(e){ } let sendMessageToTabs = function(tabs){ - doSendMsg(document.getElementById('keyBuffer').value, tabs) + let val = document.getElementById('keyBuffer').value + if (useUnicode){ + val = getUnicode(val) + } + + doSendMsg(val, tabs) } browser.tabs.query({ @@ -73,4 +90,4 @@ getCurrent() document.getElementById("keyBuffer").focus() document.getElementById('keyBuffer').onkeydown = sender -document.getElementById('keyBuffer').onpaste = sender \ No newline at end of file +document.getElementById('keyBuffer').onpaste = sender diff --git a/settings/options.html b/settings/options.html index e4b6e4e..acc40bd 100644 --- a/settings/options.html +++ b/settings/options.html @@ -12,6 +12,9 @@
+ + +

Trusted domains (comma delimited)

diff --git a/settings/options.js b/settings/options.js index 175ef0b..483bfbe 100644 --- a/settings/options.js +++ b/settings/options.js @@ -27,6 +27,9 @@ function saveOptions(e) { browser.storage.sync.set({ keyboardprivacyprompt: document.querySelector("#usePrompt").checked }) + browser.storage.sync.set({ + keyboardprivacyunicode: document.querySelector("#useUnicode").checked + }) document.getElementById('saved').innerHTML = '
Saved' setTimeout(function(){ document.getElementById('saved').innerHTML = '
' @@ -49,6 +52,10 @@ function saveOptions(e) { document.querySelector("#usePrompt").checked = result['keyboardprivacyprompt'] } + function setCurrentUnicode(result){ + document.querySelector("#useUnicode").checked = result['keyboardprivacyunicode'] + } + function onError(error) { console.log(`Error: ${error}`); } @@ -61,6 +68,9 @@ function saveOptions(e) { let gettingPrompt = browser.storage.sync.get("keyboardprivacyprompt"); gettingPrompt.then(setCurrentPrompt, onError); + + let gettingUnicode = browser.storage.sync.get("keyboardprivacyunicode"); + gettingUnicode.then(setCurrentUnicode, onError); } document.addEventListener("DOMContentLoaded", restoreOptions); diff --git a/settings/unicodemapping.js b/settings/unicodemapping.js new file mode 100644 index 0000000..e97f701 --- /dev/null +++ b/settings/unicodemapping.js @@ -0,0 +1,110 @@ +let getUnicode = function(input){ + const uc = + { + "a": [ + "\u0430", + "\u00e0", + "\u00e1", + "\u1ea1", + "\u0105" + ], + "c": [ + "\u0441", + "\u0188", + "\u010b" + ], + "d": [ + "\u0501", + "\u0257" + ], + "e": [ + "\u0435", + "\u1eb9", + "\u0117", + "\u0117", + "\u00e9", + "\u00e8" + ], + "g": [ + "\u0121" + ], + "h": [ + "\u04bb" + ], + "i": [ + "\u0456", + "\u00ed", + "\u00ec", + "\u00ef" + ], + "j": [ + "\u0458", + "\u029d" + ], + "k": [ + "\u03ba" + ], + "l": [ + "\u04cf", + "\u1e37" + ], + "n": [ + "\u0578" + ], + "o": [ + "\u043e", + "\u03bf", + "\u0585", + "\u022f", + "\u1ecd", + "\u1ecf", + "\u01a1", + "\u00f6", + "\u00f3", + "\u00f2" + ], + "p": [ + "\u0440" + ], + "q": [ + "\u0566" + ], + "s": [ + "\u0282" + ], + "u": [ + "\u03c5", + "\u057d", + "\u00fc", + "\u00fa", + "\u00f9" + ], + "v": [ + "\u03bd", + "\u0475" + ], + "x": [ + "\u0445", + "\u04b3" + ], + "y": [ + "\u0443", + "\u00fd" + ], + "z": [ + "\u0290", + "\u017c" + ] + } + let output = '' + + input.split("").forEach(element => { + if (uc[element] === undefined){ + output += element + } + else{ + output += uc[element][0] + } + }) + return output + } \ No newline at end of file