From e622b7052ea77a2e91cf80d44bccc9ef910ec10e Mon Sep 17 00:00:00 2001 From: writecode Date: Mon, 6 May 2019 02:30:13 +0000 Subject: Upload files to 'addon_firefox/ismitmlink' --- addon_firefox/ismitmlink/bg.js | 49 +++++++++++++++++++--------------- addon_firefox/ismitmlink/cs.js | 4 +-- addon_firefox/ismitmlink/manifest.json | 4 +-- 3 files changed, 32 insertions(+), 25 deletions(-) (limited to 'addon_firefox') diff --git a/addon_firefox/ismitmlink/bg.js b/addon_firefox/ismitmlink/bg.js index 6a2a9393..61ad2383 100644 --- a/addon_firefox/ismitmlink/bg.js +++ b/addon_firefox/ismitmlink/bg.js @@ -1,11 +1,11 @@ let apiurl = 'https://searxes.danwin1210.me/collab/open/ismitm.php'; let TORapiurl = 'http://searxes.nmqnkngye4ct7bgss4bmv5ca3wpa55yugvxen5kz2bbq67lwy6ps54yd.onion/collab/open/ismitm.php'; -fetch('http://searxes.nmqnkngye4ct7bgss4bmv5ca3wpa55yugvxen5kz2bbq67lwy6ps54yd.onion/collab/open/hi.php', { +fetch('http://searxes.nmqnkngye4ct7bgss4bmv5ca3wpa55yugvxen5kz2bbq67lwy6ps54yd.onion/collab/open/ok', { method: 'GET', mode: 'cors' }).then(r => r.text()).then(r => { - if (r == 'hi') { + if (r == 'ok') { apiurl = TORapiurl; } }).catch(() => {}); @@ -56,22 +56,29 @@ function i_remember_you(f, t) { }); } -browser.storage.local.clear().then(() => { - browser.runtime.onMessage.addListener((request, sender, sendResponse) => { - if (request && sender) { - i_already_know_you(request).then((r) => { - if (r == 1 || r == -1) { - browser.tabs.sendMessage(sender.tab.id, [request, ((r == 1) ? true : false)]); - } - if (r == 0) { - is_infected(request).then((a) => { - i_remember_you(request, a); - browser.tabs.sendMessage(sender.tab.id, [request, a]); - }, () => { - browser.tabs.sendMessage(sender.tab.id, [request, false]); - }); - } - }, () => {}); - } - }); -}, () => {}); \ No newline at end of file +function clear_cache_week() { + browser.storage.local.clear(); + setTimeout(function () { + clear_cache_week(); + }, 604800000); +} + +clear_cache_week(); + +browser.runtime.onMessage.addListener((request, sender, sendResponse) => { + if (request && sender) { + i_already_know_you(request).then((r) => { + if (r == 1 || r == -1) { + browser.tabs.sendMessage(sender.tab.id, [request, ((r == 1) ? true : false)]); + } + if (r == 0) { + is_infected(request).then((a) => { + i_remember_you(request, a); + browser.tabs.sendMessage(sender.tab.id, [request, a]); + }, () => { + browser.tabs.sendMessage(sender.tab.id, [request, false]); + }); + } + }, () => {}); + } +}); diff --git a/addon_firefox/ismitmlink/cs.js b/addon_firefox/ismitmlink/cs.js index 1361a666..fdc2fe02 100644 --- a/addon_firefox/ismitmlink/cs.js +++ b/addon_firefox/ismitmlink/cs.js @@ -6,8 +6,8 @@ if (document.body && !['searxes.danwin1210.me', 'searxes.nmqnkngye4ct7bgss4bmv5c })(); if (cs) { cs.insertRule("a[data-mitm]{text-decoration-line:line-through !important;text-decoration-color:red !important;text-decoration-style:double !important}", 0); - cs.insertRule("a[data-mitm]::before{content:'[MITM!]';font-weight:bold !important;color:red !important}", 1); - cs.insertRule("a[data-mitm]:hover::before{content:'[Privacy Risk!!]'}", 2); + cs.insertRule("a[data-mitm]::before{content:'[\\26A0]';font-weight:bold !important;color:red !important;display:inline-block !important}", 1); + cs.insertRule("a[data-mitm]:hover::before{content:'[\\26A1]'}", 2); cs.insertRule("a[data-mitm]:hover{color:red !important}", 3); } let asked = ['searxes.danwin1210.me', 'searxes.nmqnkngye4ct7bgss4bmv5ca3wpa55yugvxen5kz2bbq67lwy6ps54yd.onion', 'searxes.cyb', 'addons.mozilla.org']; diff --git a/addon_firefox/ismitmlink/manifest.json b/addon_firefox/ismitmlink/manifest.json index f064778d..5b4b7913 100644 --- a/addon_firefox/ismitmlink/manifest.json +++ b/addon_firefox/ismitmlink/manifest.json @@ -2,8 +2,8 @@ "manifest_version": 2, "name": "Are links vulnerable to MITM attack?", "description": "Scan FQDN using Searxes' API", - "version": "1.0.4", - "homepage_url": "https://notabug.org/themusicgod1/cloudflare-tor/src/master/ismitmlink", + "version": "1.0.5", + "homepage_url": "https://notabug.org/themusicgod1/cloudflare-tor", "author": "Maslin Bossé", "permissions": [ "storage", -- cgit v1.2.3