From: Michael Orlitzky Date: Fri, 3 Nov 2023 17:42:21 +0000 (-0400) Subject: index.html.in: also validate the origin/destination when the page loads X-Git-Url: http://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=4ba20e16ecbf993cce1150fecec87c2b9fe4d5b6;p=charm-bypass.git index.html.in: also validate the origin/destination when the page loads Firefox (at least) retains your origin/destination selections when the page reloads, so if we don't validate those choices at page load, it's possible to "skip" validation of an invalid pair by submitting the form right after a reload. --- diff --git a/index.html.in b/index.html.in index 8529b35..ac8b2be 100644 --- a/index.html.in +++ b/index.html.in @@ -889,6 +889,10 @@ document.getElementsByName("destination").forEach( (x) => x.addEventListener("change", validate_origin_destination) ); + + /* Also do it when the page loads, because firefox likes to + * remember your selection even after the page reloads. */ + window.addEventListener("load", validate_origin_destination); }