From 3d95df8d5acad5838f0c499fac6786118d96407e Mon Sep 17 00:00:00 2001 From: TheGeneralist <180094941+thegeneralist01@users.noreply.github.com> Date: Sun, 19 Jul 2026 14:41:41 +0200 Subject: [PATCH] fix(core): clean up Freedium chrome and drop reader-mode debug counters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two fixes: 1. freedium_cleanup: remove remaining Freedium article chrome that survived the existing nav/footer/toaster pass: -
— author/metadata bar with profile pictures and byline, a Freedium wrapper around the article -
containing [data-slot="dropdown-menu-trigger"] or [aria-haspopup="menu"] — the "Download article" dropdown Selectors target stable Tailwind utility class prefixes (p-6, bg-gray-50, bg-zinc-800) for the header and the WAI-ARIA menu role for the button, both resilient to minor Freedium UI updates. 2. Reader-mode meta tag: strip per-capture debug counters. _archivrReaderMark now writes 'applied' instead of 'applied:pre_s=N,...:post_s=N,...' — the counters were useful during development but have no place as permanent archive content. --- crates/archivr-core/src/downloader/singlefile.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/crates/archivr-core/src/downloader/singlefile.rs b/crates/archivr-core/src/downloader/singlefile.rs index 98fda19..9eacf83 100644 --- a/crates/archivr-core/src/downloader/singlefile.rs +++ b/crates/archivr-core/src/downloader/singlefile.rs @@ -124,7 +124,7 @@ const READER_MODE_SCRIPT: &str = concat!( 'blockquote{border-left:3px solid #ccc;margin:1em 0;padding-left:1.2em;color:#555}', ].join(''); document.head.appendChild(style); - _archivrReaderMark('applied:pre_s='+_pre.seen+',pre_l='+_pre.lazy+',pre_p='+_pre.placeholders+',pre_f='+_pre.fixed+':post_s='+_post.seen+',post_l='+_post.lazy+',post_p='+_post.placeholders+',post_f='+_post.fixed); + _archivrReaderMark('applied'); } catch (e) { _archivrReaderMark('failed:exception:' + (e && e.message ? e.message : String(e))); } @@ -531,6 +531,13 @@ fn save_with( var _pr=document.getElementById('progress');if(_pr)_pr.remove();\ document.querySelectorAll('[data-nosnippet]').forEach(function(el){\ if(!el.firstElementChild&&!el.textContent.trim())el.remove();\ + });\ + document.querySelectorAll('[data-slot=\"dropdown-menu-trigger\"]').forEach(function(btn){\ + if(!/download/i.test(btn.textContent||''))return;\ + var sec=btn.closest('section');if(!sec)return;\ + var prev=sec.previousElementSibling;\ + if(prev&&prev.tagName==='HEADER')prev.remove();\ + sec.remove();\ });", ); }