Last active
February 15, 2024 22:36
-
-
Save florinbarbisch/b75031c50182d99f903f4fb9051111de to your computer and use it in GitHub Desktop.
Automatically clicks the "Einloggen mit Switch AII" Button for the learning plattform spaces
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
// ==UserScript== | |
// @name spaces.fhnw.ch redirect to Switch AII login page | |
// @namespace https://florin.barbisch.ch/ | |
// @version 0.1 | |
// @description Automatically clicks the "Einloggen mit Switch AII" Button | |
// @author Florin Barbisch | |
// @match https://spaces.technik.fhnw.ch/ | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=spaces.technik.fhnw.ch | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
const result = document.evaluate("/html/body/header/nav/div/div[7]/div/button/div[1]/div/div", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null) | |
const profileIcon = result.singleNodeValue | |
if (profileIcon == null) { | |
window.location.href = "https://spaces.technik.fhnw.ch/shibboleth-login"; | |
} else { | |
console.log("Logged in") | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment