Created
July 1, 2019 13:30
-
-
Save Artistan/4f92c725e602f05e0d566ea0c7e68997 to your computer and use it in GitHub Desktop.
Netchex Online Login - trigger event to auto login.
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
// ==UserScript== | |
// @name netchexonline | |
// @namespace artistan | |
// @version 0.1 | |
// @description skip username page | |
// @author You | |
// @match https://netchexonline.net/n/Login/ | |
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js | |
// @require https://git.io/waitForKeyElements.js | |
// @grant all | |
// ==/UserScript== | |
waitForKeyElements("#username", function(elem) { | |
jQuery("#username").val('jimbob.'); | |
triggerEvent("input", "#username"); | |
jQuery("#btnLogin").click(); | |
}); | |
// jQuery events not working for angular, need direct DOM manipulation | |
function triggerEvent(e, s){ | |
"use strict"; | |
var event = document.createEvent('HTMLEvents'); | |
event.initEvent(e, true, true); | |
document.querySelector(s).dispatchEvent(event); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment