DynamoAlarm

🌲kattn

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        DynamoAlarm
// @namespace   Zweitmarkt Alarm
// @match       *://karten.dynamo-dresden.de/*
// @grant       none
// @version     187.1.8.7
// @author      -
// @description 🌲kattn
// ==/UserScript==

function main() {
  const bodyEl = document.body.textContent.toLowerCase();
  if (bodyEl.includes("6. ligaheimspiel")) {
    if (bodyEl.includes("zweitmarkt") || bodyEl.includes("filter")) {
      new Audio("http://dl.dropboxusercontent.com/scl/fi/3901qni32qqrwzimcb6vg/alarm.mp3?rlkey=6pvo79inlqhhgxrzmftbo7h9f&st=istrp926&dl=0").play()

      const body = document.getElementsByTagName("body")[0];
      body.style.setProperty("background-color", "green", "important");

      setTimeout(() => {
        body.style.setProperty("background-image", "none", "important");
      }, 500)
    } else {
      setTimeout(() => {
        location.reload()
      }, 5000)
    }
  }
}

window.addEventListener("load", function() {
  main();
});