Skip to content

Instantly share code, notes, and snippets.

@Artistan
Created July 1, 2019 13:30
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 Artistan/4f92c725e602f05e0d566ea0c7e68997 to your computer and use it in GitHub Desktop.
Save Artistan/4f92c725e602f05e0d566ea0c7e68997 to your computer and use it in GitHub Desktop.
Netchex Online Login - trigger event to auto login.
// ==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