Trollbox Ping

Pings you when somones says your name on Trollbox.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         Trollbox Ping
// @namespace    trollboxping
// @version      1.1
// @description  Pings you when somones says your name on Trollbox.
// @author       1024x2
// @match        *://*.windows93.net/trollbox/
// @grant        none
// ==/UserScript==

function handleMsg(event) {
  if (event.target.parentNode.id == "trollbox_scroll") {
    if (event.target.children[2].innerText.includes(pseudo.replace(/​/g, "")) && event.target.children[1].innerText != "→" &&
        event.target.children[1].innerText != "←" && event.target.children[1].innerText != "~") {
      new Audio("https://canary.discordapp.com/assets/dd920c06a01e5bb8b09678581e29d56f.mp3").play();
      event.target.children[2].style.backgroundColor = "rgba(255, 255, 0, 0.25)";
    }
  }
}

document.getElementById("trollbox_scroll").addEventListener("DOMNodeInserted", handleMsg);