您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Simply hides posts from specific user-specified domains on HackerNews front page
当前为
// ==UserScript== // @name Hide Domains on HackerNews // @match https://news.ycombinator.com/ // @match https://news.ycombinator.com/?p=* // @version 1.0 // @grant none // @namespace ahappyviking // @license MIT // @description Simply hides posts from specific user-specified domains on HackerNews front page // @icon https://www.kindpng.com/picc/m/61-613142_see-no-evil-monkey-icon-monkey-eyes-closed.png // ==/UserScript== let hiddenDomains = ["dailymail.co.uk"] function hidedomainsonhn_main() { let links = document.getElementsByClassName("sitestr"); let numberOfBlocked = 0 for (let link of links) { if (hiddenDomains.includes(link.innerHTML)) { let owner = link.closest(".title"); owner.firstChild?.replaceWith(hidedomainsonhn_createBlockNotice(link.innerHTML)) numberOfBlocked++ } } if (numberOfBlocked) { hidedomainsonhn_addBlockCount(numberOfBlocked); } } function hidedomainsonhn_createBlockNotice(domain) { const notice = document.createElement("p"); notice.innerText = domain notice.style.width = "fit-content" notice.style.fontSize = "10px" notice.style.padding = "2px" notice.style.textDecoration = "line-through" return notice } function hidedomainsonhn_addBlockCount(blockCount) { const text = document.createElement("p") text.style.margin = "0 0 8 0" text.style.userSelect = "none" text.innerText = `Blocked domains: ${blockCount}` text.style.color = "grey" text.style.fontSize = "10px" document.getElementById("pagespace")?.after(text) } hidedomainsonhn_main()
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址