4 ms·
Userscript/Violentmonkey version // ==UserScript== // @name Hide Specific HN Entries // @namespace Violentmonkey Scripts // @version 0.
by smnrg 3y ago
Userscript/Violentmonkey version
// ==UserScript==
// @name Hide Specific HN Entries
// @namespace Violentmonkey Scripts
// @version 0.1
// @description Hide HN entries from specific websites
// @author h_o_o_t, smnrg
// @match https://news.ycombinator.com/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
const blockedSites = [
'businessinsider.com',
'dailymail.co.uk',
'foxnews.com',
'theverge.com',
'cnn.com',
'reuters.com',
'zerohedge.com',
'insider.com',
'bloomberg.com',
'euronews.com',
'theguardian.com',
'wsj.com',
'ft.com',
'theconversation.com',
'thetimes.co.uk',
'bbc.co.uk',
'nytimes.com',
'newyorker.com',
'theatlantic.com',
'bbycroft.net'
];
const entries = document.querySelectorAll('table:not(.fatitem) tr > td.title');
entries.forEach(entry => {
const link = entry.querySelector('a');
if (link && blockedSites.some(site => link.href.includes(site))) {
const row = entry.parentElement;
row.style.display = 'none';
if (row.nextElementSibling) row.nextElementSibling.style.display = 'none';
if (row.nextElementSibling && row.nextElementSibling.nextElementSibling) row.nextElementSibling.nextElementSibling.style.display = 'none';
}
});
})();
- h_o_o_t 3y agoAwesome! :)
- frfl 3y agoI have a similar one that filters on keywords as well as URLs, https://paste.sh/5XE7NvGM#Zb9Wx4P9Pi5XbIO01igypbk2 https://paste.sh/5XE7NvGM#Zb9Wx4P9Pi5XbIO01igypbk2
- KomoD 3y agoI have one that filters on keywords too, with a toggle button to show them again in red, been thinking about adding URLs for a while but never got around to it
- deleted 3y ago[deleted]