Skip to content

Instantly share code, notes, and snippets.

@hadongsoo
Created January 6, 2020 12:12
Show Gist options
  • Save hadongsoo/d7fbee685710ad060c0dc469d8c22517 to your computer and use it in GitHub Desktop.
Save hadongsoo/d7fbee685710ad060c0dc469d8c22517 to your computer and use it in GitHub Desktop.
gm_fill_form
// ==UserScript==
// @name logon
// @namespace https://www.formexample.com
// @include https://www.formexample.com
// @version 1
// @grant none
// @rut-at document-start
const TIMEOUT = 2;
const NAME = "***";
const PASSWORD = "***";
document.addEventListener("load", function() {
setTimeout(function() {
document.querySelector("input[name=username]").value = NAME;
document.querySelector("input[name=passcode]").value = PASSWORD;
document.querySelector("input[name=passcode]").form.submit();
}, TIMEOUT * 1000);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment