NovelUpdates Warning for Hiatus, Axed, Discontinued, etc.

This will display a red warning label for any series that aren't likely to be finished due do being axed, etc. based on the status field of the NU page.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        NovelUpdates Warning for Hiatus, Axed, Discontinued, etc.
// @description This will display a red warning label for any series that aren't likely to be finished due do being axed, etc. based on the status field of the NU page.
// @version     0.1
// @match       https://www.novelupdates.com/series/*
// @icon        https://www.novelupdates.com/favicon.ico
// @license MIT
// @namespace https://greasyfork.org/users/721922
// ==/UserScript==


function addStatusText(text) {
  const title = document.querySelector(".seriestitlenu");
  const statusSpan = document.createElement("span");
  statusSpan.style = "color: #ff0000; text-transform: capitalize";
  statusSpan.textContent = ` (${text})`;
  title.append(statusSpan);
}


function main() {
  const statusDiv = document.querySelector("#editstatus");
  const results = statusDiv.textContent.match(/\b(?:hiatus|discontinued|axed|dead|death|cancelled|unfinished)\b/i);
  console.log(results);
  if (results && results.length) {
    const statusText = results[0];
    addStatusText(statusText);
  }
}


main();