mirror of
https://github.com/thegeneralist01/archivr
synced 2026-07-21 18:55:36 +02:00
fix(core): tighten Freedium download-button cleanup
Replace the broad previousElementSibling/HEADER removal with a precise selector that matches only the .flex.justify-end wrapper containing the 'Download article' button. The old heuristic was removing article headers on NYT/WaPo captures.
This commit is contained in:
parent
64f94c6eda
commit
00e3b966ee
1 changed files with 6 additions and 6 deletions
|
|
@ -540,12 +540,12 @@ fn save_with(
|
|||
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();\
|
||||
document.querySelectorAll('section>.flex.justify-end>button[data-slot=\"dropdown-menu-trigger\"][type=\"button\"].flex.items-center>span').forEach(function(span){\
|
||||
if(span.textContent.trim()!=='Download article')return;\
|
||||
var wrap=span.closest('.flex.justify-end');\
|
||||
var sec=wrap.closest('section');\
|
||||
wrap.remove();\
|
||||
if(sec&&sec.children.length===0)sec.remove();\
|
||||
});",
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue