HumAnTarg3t / twitchParasocial_Logger

Other
0 stars 1 forks source link

change title of client based on what tab u are in #11

Open HumAnTarg3t opened 9 months ago

HumAnTarg3t commented 9 months ago

"streamers" chat

something like that

HumAnTarg3t commented 9 months ago
      // Get the button with the class "active" inside the div with the class "tabLinks"
      const activeButton = document.querySelector(".tabLinks .active");

      // Check if an active button was found
      if (activeButton) {
        // Get the inner text of the active button
        const buttonText = activeButton.innerText;
        document.title = `${buttonText}s chat`;
      } else {
        console.log('No button with class "active" found.');
      }