// ==UserScript== // @name Moodle auto sing in // @name:he חיבור אוטומטי למודל // @namespace http://tampermonkey.net/ // @version 0.1 // @description Connect to moodle with a click // @description:he סקריפט חיבור למודל // @author You // @include https://sason-p.technion.ac.il/* // @match https://moodle.technion.ac.il/my/ // @grant none // @downloadURL none // ==/UserScript== (function() { 'use strict'; // Your code here... // function myFunction(){ document.forms[0].elements["j_username"].value="CHANGE_USERNAME@campus.technion.ac.il"; document.forms[0].elements[4].value="campus.technion.ac.il"; document.forms[0].elements["j_password"].value="CHANGE_PASSWORD"; var classt = document.getElementsByClassName('btn btn-primary'); document.forms[0].elements[9].click(); } function redirectME() { var classt = document.getElementsByClassName('usertext'); if (classt.length === 0) { window.location.href = 'https://moodle.technion.ac.il/auth/shibboleth/index.php'; } } var tnai=window.location.host; if (tnai=="moodle.technion.ac.il") { redirectME(); } else if (tnai=="sason-p.technion.ac.il") { setTimeout(myFunction, 3000); } else { } })();