Skip to content
This repository was archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
feat: add auto login script
Browse files Browse the repository at this point in the history
  • Loading branch information
adil192 committed Jan 25, 2024
1 parent 4d9144e commit 9e9320d
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Here I will outline the changes I've made over time...

### 20240125

- Added a script to automatically click the login button on the Blackboard login page if your details are saved in your browser (see the [README][README] for instructions)

### 20240123

- Restyled the asides in course pages (in my course, they're labelled "Learning Outcomes" on each week's section)
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ other UoM websites.
- [Highlight current modules](https://greasyfork.org/en/scripts/478967-uom-blackboard-highlight-current-modules)
- [Video keyboard shortcuts](https://greasyfork.org/en/scripts/479044-uom-blackboard-video-keyboard-shortcuts)
- [Module list images](https://greasyfork.org/en/scripts/479199-uom-blackboard-add-course-images)
- [Auto login](https://greasyfork.org/en/scripts/485669-uom-blackboard-auto-login)

### Atkinson Hyperlegible

Expand Down
37 changes: 37 additions & 0 deletions scripts/auto_login.js
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();
}
})();

0 comments on commit 9e9320d

Please sign in to comment.