Skip to content

Instantly share code, notes, and snippets.

@tVienonen
Created September 27, 2021 12:03
Show Gist options
  • Save tVienonen/91aec68716d0efea8e305a58ab192ecd to your computer and use it in GitHub Desktop.
Save tVienonen/91aec68716d0efea8e305a58ab192ecd to your computer and use it in GitHub Desktop.
Hides Iltalehti.fi plus articles from main feed
// 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