Last active
November 5, 2024 09:17
-
-
Save pmakholm/22879836215c042ba6505d860cc50b02 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// ==UserScript== | |
// @name Hide DR Valg i USA Links | |
// @namespace http://tampermonkey.net/ | |
// @version 1.0 | |
// @description Hides articles and links that match the specified URLs on dr.dk | |
// @author Peter Makholm ([email protected]) | |
// @match https://www.dr.dk/nyheder | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
// Skjul Valg i USA-temaet | |
document.querySelectorAll("div.dre-share-link-copy-url__copy-link-hidden").forEach(node => { | |
if (node.textContent.includes('https://www.dr.dk/nyheder/udland/valg-i-usa/')) { | |
const listItem = node.closest("li.hydra-latest-news-page__short-news-item"); | |
if (listItem) { | |
listItem.style.display = "none"; | |
} | |
} | |
}); | |
document.querySelectorAll("a.hydra-card-title").forEach(node => { | |
if (node.href.includes('https://www.dr.dk/nyheder/udland/valg-i-usa/')) { | |
const listItem = node.closest("li.hydra-latest-news-page__index-list-item, li.hydra-latest-news-page__short-news-item"); | |
if (listItem) { | |
listItem.style.display = "none"; | |
} | |
} | |
}); | |
// Skjul artikler om Trump | |
document.querySelectorAll("div.dre-share-link-copy-url__copy-link-hidden").forEach(node => { | |
if (node.textContent.includes('trump')) { | |
const listItem = node.closest("li.hydra-latest-news-page__short-news-item"); | |
if (listItem) { | |
listItem.style.display = "none"; | |
} | |
} | |
}); | |
document.querySelectorAll("a.hydra-card-title").forEach(node => { | |
if (node.href.includes('trump')) { | |
const listItem = node.closest("li.hydra-latest-news-page__index-list-item, li.hydra-latest-news-page__short-news-item"); | |
if (listItem) { | |
listItem.style.display = "none"; | |
} | |
} | |
}); | |
// Skjul artikler om Harris | |
document.querySelectorAll("div.dre-share-link-copy-url__copy-link-hidden").forEach(node => { | |
if (node.textContent.includes('harris')) { | |
const listItem = node.closest("li.hydra-latest-news-page__short-news-item"); | |
if (listItem) { | |
listItem.style.display = "none"; | |
} | |
} | |
}); | |
document.querySelectorAll("a.hydra-card-title").forEach(node => { | |
if (node.href.includes('harris')) { | |
const listItem = node.closest("li.hydra-latest-news-page__index-list-item, li.hydra-latest-news-page__short-news-item"); | |
if (listItem) { | |
listItem.style.display = "none"; | |
} | |
} | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment