From 17321d508a1a7cab9415ff2a16df08f0604fba1e Mon Sep 17 00:00:00 2001 From: Natsumi Date: Wed, 25 Aug 2021 06:00:41 +1200 Subject: [PATCH] DevTools warning --- html/src/app.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/html/src/app.js b/html/src/app.js index df476cac..93bd0b6c 100644 --- a/html/src/app.js +++ b/html/src/app.js @@ -67,10 +67,25 @@ speechSynthesis.getVoices(); configRepository.setBool('migrate_config_20201101', true); } + var showConsoleWarningMessage = function () { + if ($app.debug || $app.debugWebRequests || $app.debugWebSocket) { + return; + } + console.log( + '%cCareful! This might not do what you think.', + 'background-color: red; color: yellow; font-size: 32px; font-weight: bold' + ); + console.log( + '%cIf someone told you to copy-paste something here, it can give them access to your account.', + 'font-size: 20px;' + ); + }; + document.addEventListener('keyup', function (e) { if (e.ctrlKey) { if (e.key === 'I') { AppApi.ShowDevTools(); + showConsoleWarningMessage(); } else if (e.key === 'r') { location.reload(); }