Created
September 26, 2023 18:53
-
-
Save memetican/40d393a5be59aa4fb74f2eaa2d604d3d to your computer and use it in GitHub Desktop.
Webflow Auto-Login Hack
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
document.addEventListener('DOMContentLoaded', function() { | |
// Function to get a query string value by name | |
function getParameterByName(name, url) { | |
if (!url) url = window.location.href; | |
name = name.replace(/[\[\]]/g, '\\$&'); | |
const regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'), | |
results = regex.exec(url); | |
if (!results) return null; | |
if (!results[2]) return ''; | |
return decodeURIComponent(results[2].replace(/\+/g, ' ')); | |
} | |
const passValue = getParameterByName('pass'); | |
if (passValue) { | |
const passInput = document.querySelector('input[name="pass"]'); | |
if (passInput) { | |
passInput.value = passValue; | |
const form = passInput.closest('form'); | |
if (form) { | |
form.submit(); | |
} | |
} | |
} | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment