Ну допустим так.
const camelToSnake = (string, toUpper = false) => {
const preparedString = string.replace(/[A-Z]/g, '_$&');
return toUpper ? preparedString.toUpperCase() : preparedString.toLowerCase();
};
window.addEventListener('DOMContentLoaded', () => {
const params = new URLSearchParams(location.search);
const keys = params.keys();
for (const key of keys) {
const field = document.querySelector(`input[name="${camelToSnake(key, true)}"]`);
if (field !== null) {
field.value = params.get(key);
}
}
});