diff --git a/background.js b/background.js index 518c42b..aac4d81 100644 --- a/background.js +++ b/background.js @@ -66,13 +66,44 @@ let appCode = function (){ if (e.key.startsWith('Arrow') || e.key.startsWith('Page')){ return true; } - pausecomp(down); we + pausecomp(down); return true; }) }, 100) } + function checkForLANThenRun(){ + + let lan = browser.storage.sync.get("keyboardprivacylan"); + lan.then(function(val){ + + if (! val['keyboardprivacylan']){ + mainKeyboardPrivacy() + } + else{ + let hostname = document.location.hostname + if (/^(10)\.(.*)\.(.*)\.(.*)$/.test(hostname)){ + //10.x.x.x + }else if (/^(172)\.(1[6-9]|2[0-9]|3[0-1])\.(.*)\.(.*)$/.test(hostname)){ + //172.16.x.x - 172.31.255.255 + }else if (/^(192)\.(168)\.(.*)\.(.*)$/.test(hostname)){ + //192.168.x.x + }else if (/^(127)\.(.*)\.(.*)\.(.*)$/.test(hostname)){ + } + else if (hostname == '[::1]'){ + } + else { + mainKeyboardPrivacy() + return + } + + console.debug("Not running private keyboard because lan/loopback hostname") + } + + }, function(val){mainKeyboardPrivacy()}) + + } function shouldRunKeyboardPrivacy(value){ if (typeof value.keyboardprivacywhitelist === 'undefined'){ mainKeyboardPrivacy() @@ -85,7 +116,8 @@ let appCode = function (){ return } } - mainKeyboardPrivacy() + checkForLANThenRun() + } function noKeyboardPrivacySettings(value){ mainKeyboardPrivacy() diff --git a/manifest.json b/manifest.json index 7a37d1c..c5586b8 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 2, "name": "Private Keyboard", - "version": "1.6", + "version": "1.8", "description": "Protect against keyboard biometrics", diff --git a/settings/options.css b/settings/options.css new file mode 100644 index 0000000..35b5e58 --- /dev/null +++ b/settings/options.css @@ -0,0 +1,3 @@ +body{ + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; +} diff --git a/settings/options.html b/settings/options.html index 6142c64..41d76a1 100644 --- a/settings/options.html +++ b/settings/options.html @@ -3,12 +3,15 @@
+ -