Medium: dim already-read articles
Remembers articles you clicked and dims their feed cards so you do not revisit the same text.
Code to copy
// Dim feed cards whose article link has already been visited
(function () {
const STYLE_ID = 'jz-med-visited';
if (!document.getElementById(STYLE_ID)) {
const s = document.createElement('style');
s.id = STYLE_ID;
s.textContent = '.jz-med-seen{opacity:.5!important}';
document.head.appendChild(s);
}
function mark() {
document.querySelectorAll('article a[href]').forEach(function (a) {
try {
const key = 'jzmed:' + new URL(a.href).pathname;
if (localStorage.getItem(key)) {
const card = a.closest('article');
if (card) { card.classList.add('jz-med-seen'); }
}
a.addEventListener('click', function () {
try { localStorage.setItem(key, '1'); } catch (e) {}
});
} catch (e) {}
});
}
mark();
new MutationObserver(mark).observe(document.body,
{ childList: true, subtree: true });
})();
How to use this example
- Copy the code with the button above.
- Install JustZix (2 minutes) and open the extension on the target page.
- Add a new rule matching that page.
- Paste the code into the rule's JavaScript panel and save — it runs on every page visit.
Rate this example
No ratings yet — be the first.