From e19e23022b1199a9169028201b004658e7e27aa4 Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Sun, 23 Aug 2020 06:29:40 -0500 Subject: [PATCH] show message if user tries to open .onion as onionr site --- static-data/www/shared/main/recent.js | 2 +- static-data/www/shared/sites.js | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/static-data/www/shared/main/recent.js b/static-data/www/shared/main/recent.js index 4e7c8615..fa357597 100644 --- a/static-data/www/shared/main/recent.js +++ b/static-data/www/shared/main/recent.js @@ -34,7 +34,7 @@ var getRecent = function(){ if (existing.includes(key)){ return } - existing = key + " - " + value + "\n" + existing + existing = "\n" + key + " - " + value + "\n" + existing }) document.getElementsByClassName('recentBlockList')[0].innerText = existing console.debug(data) diff --git a/static-data/www/shared/sites.js b/static-data/www/shared/sites.js index fc9b7fb1..872b2c30 100755 --- a/static-data/www/shared/sites.js +++ b/static-data/www/shared/sites.js @@ -25,7 +25,13 @@ function checkHex(str) { } document.getElementById('openSite').onclick = function(){ - var hash = document.getElementById('siteViewer').value + var hash = document.getElementById('siteViewer').value.trim() + if (hash.includes('.onion')){ + PNotify.notice({ + text: 'This is for Onionr sites, not Tor onion services.' + }) + return + } if (hash.length == 0){ return } if (checkHex(hash) && hash.length >= 50 || hash.length == 52 || hash.length == 56){ window.location.href = '/site/' + hash