This repository was archived by the owner on Jul 9, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// ==UserScript== | ||
// @name UoM Blackboard: Auto login | ||
// @namespace http://tampermonkey.net/ | ||
// @version 20240125.00.00 | ||
// @description An optional accompanying script for https://github.com/adil192/BlackboardTheme, which automatically clicks the login button if your username and password are saved in the browser. | ||
// @author adil192 | ||
// @match https://login.manchester.ac.uk/cas/login* | ||
// @icon https://www.google.com/s2/favicons?sz=64&domain=manchester.ac.uk | ||
// @grant none | ||
// @license Unlicense | ||
// @downloadURL https://github.com/adil192/BlackboardTheme/raw/main/scripts/auto_login.js | ||
// ==/UserScript== | ||
|
||
// @ts-check | ||
|
||
(function () { | ||
'use strict'; | ||
|
||
console.log("UoM Blackboard: Auto login"); | ||
|
||
/** The username input. @type {HTMLInputElement | null} */ | ||
const username = document.querySelector("input#username"); | ||
/** The password input. @type {HTMLInputElement | null} */ | ||
const password = document.querySelector("input#password"); | ||
/** The submit button. @type {HTMLInputElement | null} */ | ||
const submit = document.querySelector("input[type=submit]"); | ||
|
||
if (!username || !password || !submit) { | ||
console.log("UoM Blackboard: Auto login: Could not find username, password or submit button."); | ||
return; | ||
} | ||
|
||
if (username.value && password.value) { | ||
console.log("UoM Blackboard: Auto login: Username and password are already filled in, submitting form."); | ||
submit.click(); | ||
} | ||
})(); |