Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name HN - Label TeMPOraL π€
- // @namespace https://example.com
- // @version 1.0
- // @description Adds a conspicuous emoji label after TeMPOraL's username on Hacker News.
- // @match https://news.ycombinator.com/*
- // @grant none
- // ==/UserScript==
- (function () {
- "use strict";
- const TARGET = "TeMPOraL";
- const LABEL = " π€πΊπ¦Ύ";
- function labelUsers() {
- document.querySelectorAll("a.hnuser").forEach(el => {
- if (el.textContent.trim() !== TARGET) return;
- if (el.dataset.temporalLabeled) return;
- el.dataset.temporalLabeled = "1";
- const tag = document.createElement("span");
- tag.textContent = LABEL;
- tag.style.fontWeight = "bold";
- tag.style.fontSize = "1.1em";
- tag.style.marginLeft = "0.25em";
- el.after(tag);
- });
- }
- labelUsers();
- const observer = new MutationObserver(labelUsers);
- observer.observe(document.body, {
- childList: true,
- subtree: true
- });
- })();
Advertisement
Add Comment
Please, Sign In to add comment