Created
June 6, 2021 04:35
-
-
Save chaosifier/dcbcfc6a97b661865d33a07620dfdee6 to your computer and use it in GitHub Desktop.
Tampermonkey script for auto captcha filling in NEPSE TMS
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
| // ==UserScript== | |
| // @name TMS captcah autofill | |
| // @namespace http://tampermonkey.net/ | |
| // @version 0.1 | |
| // @description try to take over the world! | |
| // @author chaosifier | |
| // @match https://*.nepsetms.com.np/login | |
| // @grant none | |
| // ==/UserScript== | |
| (function() { | |
| 'use strict'; | |
| function triggerKeyboardEvent(el, keyCode, type) { | |
| var eventObj = document.createEventObject ? document.createEventObject() : document.createEvent("Events"); | |
| if (eventObj.initEvent) { | |
| eventObj.initEvent(type, true, true); | |
| } | |
| eventObj.keyCode = keyCode; | |
| eventObj.which = keyCode; | |
| el.dispatchEvent ? el.dispatchEvent(eventObj) : el.fireEvent("onkeydown", eventObj); | |
| } | |
| //auto fill the captcha on page load | |
| function captchaAutoFill() { | |
| captchaEnter.focus(); | |
| $("#captchaEnter").val($("#randomfield").val()); | |
| triggerKeyboardEvent(captchaEnter, captchaEnter.value.charCodeAt(0), "input") | |
| } | |
| captchaAutoFill(); | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment