From 36f9d84f7add87769212f2b34672f36c65cb3924 Mon Sep 17 00:00:00 2001 From: flofriday Date: Sat, 26 Oct 2024 15:02:39 +0200 Subject: [PATCH] Add local memorization to the original url field. Here we only store the original token in the local browser so there shouldn't be any issues but it makes it a lot easier to copy it again if you need to copy it to a new client. --- app/static/home.js | 6 ++++++ requirements.txt | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app/static/home.js b/app/static/home.js index 6e7db2e..7ad7ed9 100644 --- a/app/static/home.js +++ b/app/static/home.js @@ -18,6 +18,10 @@ let currentUrl = ""; window.onload = () => { copyBtn.disabled = true; + + if (!urlText.value && localStorage.getItem("originalUrl")) { + urlText.value = localStorage.getItem("originalUrl"); + } }; urlText.onchange = () => { @@ -72,8 +76,10 @@ async function verify(url) { try { const response = await fetch(`/verify?url=${encodeURIComponent(url)}`); if (response.ok) { + localStorage.setItem("originalUrl", url); setBetterUrl(url); } else { + localStorage.setItem("originalUrl", ""); let message = await response.text(); if (message.trim().length > 0) { setErrorMessage(message); diff --git a/requirements.txt b/requirements.txt index a8c02a3..134329e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,16 +1,16 @@ blinker==1.8.2 certifi==2024.8.30 -charset-normalizer==3.3.2 +charset-normalizer==3.4.0 click==8.1.7 flake8==7.1.1 Flask==3.0.3 gunicorn==23.0.0 -icalendar==5.0.13 +icalendar==6.0.1 idna==3.10 iniconfig==2.0.0 itsdangerous==2.2.0 Jinja2==3.1.4 -MarkupSafe==2.1.5 +MarkupSafe==3.0.2 mccabe==0.7.0 packaging==24.1 pluggy==1.5.0 @@ -21,7 +21,7 @@ pytest-mock==3.14.0 python-dateutil==2.9.0.post0 pytz==2024.2 requests==2.32.3 -ruff==0.6.5 +ruff==0.7.1 six==1.16.0 urllib3==2.2.3 Werkzeug==3.0.6