Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getUsername(){
- var userUbi;
- // I will just hardcode a username for now since this is not running in the browser.
- var username = 'Abmelden Thenlie Log out'
- // for (const a of document.querySelectorAll("a")) {
- // if (a.textContent.includes("Abmelden") || a.textContent.includes("Log out")) {
- // username = a.textContent
- // }
- // }
- if(username == null || username == undefined) {
- setTimeout(getUsername,250);
- } else {
- username = username.replace('Abmelden','');
- userUbi = username.replace('Log out','');
- console.log("Nutzername: " + userUbi)
- return userUbi;
- }
- }
- // The Main Function
- function main () {
- console.log(getUsername());
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement