Created
January 28, 2021 22:16
-
-
Save ericblade/f515ecfe2615dc8ccf56f15cbc2a6304 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
javascript:(function() { | |
const getInputElements = () => Array.from(document.getElementsByTagName('input')); | |
const getInfoCompletedElements = () => getInputElements().filter(x => x.type === 'hidden' && x.name.startsWith('infoCompleted')); | |
const getButtonElements = () => Array.from(document.getElementsByClassName('amznBtn')); | |
const getSubmitButtons = () => getButtonElements().filter(x => x.textContent === 'Submit'); | |
getInputElements().forEach(function(x) { if(x.value === 'no') x.click(); }); | |
console.warn('** getInfoCmpletedElements', getInfoCompletedElements()); | |
getInfoCompletedElements().forEach(x => x.value = "1"); | |
getButtonElements().forEach(x => { | |
x.onClick = (e) => e.preventDefault(); | |
x.form.submit(); | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment