Advertisement
Thenlie

yuskan help

Jun 7th, 2022
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function getUsername(){
  2.   var userUbi;
  3.  
  4.   // I will just hardcode a username for now since this is not running in the browser.
  5.   var username = 'Abmelden Thenlie Log out'
  6.   // for (const a of document.querySelectorAll("a")) {
  7.   //   if (a.textContent.includes("Abmelden") || a.textContent.includes("Log out")) {
  8.   //     username = a.textContent
  9.   //   }
  10.   // }
  11.  
  12.   if(username == null || username == undefined) {
  13.     setTimeout(getUsername,250);
  14.   } else {
  15.     username = username.replace('Abmelden','');
  16.     userUbi = username.replace('Log out','');
  17.     console.log("Nutzername: " + userUbi)
  18.    
  19.     return userUbi;
  20.   }
  21. }
  22.  
  23. // The Main Function
  24. function main () {
  25.   console.log(getUsername());
  26. };
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement