Oánh dấu chủ thớt

như tên

在您安装前,Greasy Fork 希望您知道此脚本声明其包含了一些负面功能。这些功能也许会使脚本作者获利,而不能给您带来任何直接的金钱收益。

此脚本含有追踪您的操作的代码。

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Oánh dấu chủ thớt
// @namespace    idmresettrial
// @version      2021.02.13.01
// @description  như tên
// @author       You
// @match        https://voz.vn/t/*
// @grant        none
// @run-at       document-start
// @antifeature  tracking
// ==/UserScript==

document.addEventListener('DOMContentLoaded', function () {
    'use strict';

    var starterId = document.querySelector(".username.u-concealed");
    if (!starterId) {
        return;
    }

    var starters = document.querySelectorAll(".message-userDetails a.username[data-user-id='" + starterId.getAttribute("data-user-id") + "']");
    if (!starters) {
        return;
    }

    var style = document.createElement('style');
    //style.innerHTML = ".userBanner.userBanner--starter {background-color: #656d88aa; color: #fff; border-color: #656d88;}";
    style.innerHTML = ".userBanner.userBanner--starter {background-color: #eaeaea; color: #282828; border-color: #828282;}";
    document.head.appendChild(style);

    for (const starter of starters) {
        var starterFlair = document.createElement("div");
        starterFlair.setAttribute("class", "userBanner userBanner--starter message-userBanner");
        starterFlair.innerHTML = "<strong>Chủ thớt</strong>";
        starter.parentElement.parentElement.appendChild(starterFlair);
    }

});