Skip to content

Instantly share code, notes, and snippets.

@mahpah
Last active January 6, 2021 15:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mahpah/ad86062b10e1ccd3e0b56f9e5a498c98 to your computer and use it in GitHub Desktop.
Save mahpah/ad86062b10e1ccd3e0b56f9e5a498c98 to your computer and use it in GitHub Desktop.
<script>
function inject() {
var query = new URL(window.location);
var code = query.searchParams.get('code');
if (!code) {
return;
}
var input = document.querySelector('input[placeholder="_ _ _ _ _ _ _ _ _ _ _ _ _ _ _"]');
if (!input) {
return;
}
var inputSetter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value").set;
inputSetter.call(input, code);
}
inject();
</script>
function inject() {
var query = new URL(window.location);
var code = query.searchParams.get('code');
if (!code) {
return;
}
var input = document.querySelector('input[placeholder="_ _ _ _ _ _ _ _ _ _ _ _ _ _ _"]');
if (!input) {
return;
}
var nativeInputValueSetter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value").set;
nativeInputValueSetter.call(input, code);
}
inject();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment