From 7a41d5af6d52fb7521990a961c6beabdbe8b9a24 Mon Sep 17 00:00:00 2001 From: jmir1 <jhmiramon@gmail.com> Date: Wed, 29 Nov 2023 16:30:58 +0100 Subject: [PATCH] fix: Prevent issues with other scripts and wait for autofill --- Uni Hamburg Moodle Auto Login.user.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Uni Hamburg Moodle Auto Login.user.js b/Uni Hamburg Moodle Auto Login.user.js index 8b74aad..dc414b1 100644 --- a/Uni Hamburg Moodle Auto Login.user.js +++ b/Uni Hamburg Moodle Auto Login.user.js @@ -5,7 +5,7 @@ // @description Automatically logs you in to the Uni Hamburg Moodle, given automated password filling. // @description:de Loggt Dich automatisch in das Moodle der Uni Hamburg ein, gegeben, dass die Login-Daten automatisch ausgefüllt werden. -// @version 1.0.3 +// @version 1.0.4 // @copyright 2023+, Jan G. (Rsge) // @license Mozilla Public License 2.0 // @icon https://lernen.min.uni-hamburg.de/theme/image.php/uhh/theme/1698645195/favicon @@ -19,7 +19,7 @@ // @match https://lernen.min.uni-hamburg.de/login/* // @match https://login.uni-hamburg.de/idp/* -// @run-at document-idle +// @run-at document-end // @grant none // ==/UserScript== @@ -34,7 +34,10 @@ } let secondLoginButtonElements = document.getElementsByClassName("form-element form-button"); if (secondLoginButtonElements.length > 0) { - secondLoginButtonElements[0].click(); + let passwordInput = document.getElementById("password"); + passwordInput.addEventListener("input", function() { + secondLoginButtonElements[0].click(); + }); } }, false); })(); -- GitLab