HN Highlight Original Poster

Highlights original poster's name on Hacker News

目前为 2023-02-24 提交的版本。查看 最新版本

// ==UserScript==
// @name         HN Highlight Original Poster
// @namespace    https://github.com/tekinosman/
// @version      1.1
// @license      MIT
// @description  Highlights original poster's name on Hacker News
// @author       Osman Tekin
// @match        https://news.ycombinator.com/item?id=*
// @match        http://news.ycombinator.com/item?id=*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=ycombinator.com
// @grant        none
// ==/UserScript==

// Original poster is the first user
let originalPoster = document.querySelector('.hnuser').innerText;

document.querySelectorAll("a[href='user?id="+originalPoster+"']").forEach( el => {
    el.style.background = "#ccc";
    el.style.color = "#f9f9f9";
    el.style.padding = "2px";
    el.style.borderRadius = "2px";
});