Created
September 27, 2021 12:03
-
-
Save tVienonen/91aec68716d0efea8e305a58ab192ecd to your computer and use it in GitHub Desktop.
Hides Iltalehti.fi plus articles from main feed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use this userscript with Tampermonkey extension | |
// ==UserScript== | |
// @name Remove PLUS articles | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Hides Iltalehti PLUS articles from the main news feed | |
// @author Topi Vienonen | |
// @match https://www.iltalehti.fi/ | |
// @icon https://www.google.com/s2/favicons?domain=iltalehti.fi | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
// Your code here... | |
document.querySelectorAll('.il-plus-svg-logo').forEach(node => { | |
let parent = node.parentNode; | |
while (parent && parent.tagName !== 'A') { | |
parent = parent.parentNode; | |
} | |
if (parent && parent.tagName === 'A') { | |
parent.remove(); | |
} | |
}) | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment