From dae9599d641ba5117525ca6dc66d24e3cabaafb4 Mon Sep 17 00:00:00 2001 From: Oleg Kalachev Date: Wed, 18 Aug 2021 21:15:31 +0300 Subject: [PATCH] web: confirm using Butterfly Terminal on a local machine --- clover/www/index.html | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/clover/www/index.html b/clover/www/index.html index 9c63ca9a..80edcb85 100644 --- a/clover/www/index.html +++ b/clover/www/index.html @@ -18,6 +18,14 @@ document.querySelector("#wvs").href = location.protocol + '//' + location.hostname + ':8080'; document.querySelector("#butterfly").href = location.protocol + '//' + location.hostname + ':57575'; + document.querySelector("#butterfly").addEventListener('click', function(e) { + if (location.hostname == 'localhost' || location.hostname == '127.0.0.1') { + if (!confirm('Please use regular Terminal app on a local machine.\nClick OK to proceed to Butterfly anyway.')) { + e.preventDefault(); + } + } + }); + // Determine image version fetch('clover_version').then(function(response) { if (response.status !== 200) return;