Filter comercials in readable
This commit is contained in:
@@ -134,12 +134,16 @@ async function getReadable(feed, index) {
|
||||
})
|
||||
// taz "Mehr zum Thema" related-articles teaser section.
|
||||
doc.querySelectorAll('#articleTeaser').forEach(el => el.remove())
|
||||
// taz subsidiary magazine promo blocks (e.g. taz FUTURZWEI): the promo
|
||||
// <article> carries an aria-label containing "Abo".
|
||||
// taz subsidiary magazine promo blocks (e.g. taz FUTURZWEI): either the
|
||||
// <article> itself or its direct <a> child carries an aria-label containing "Abo".
|
||||
doc.querySelectorAll('article[aria-label*="Abo"]').forEach(el => {
|
||||
const container = el.closest('section') ?? el
|
||||
container.remove()
|
||||
})
|
||||
doc.querySelectorAll('article > a[aria-label*="Abo"]').forEach(el => {
|
||||
const container = el.closest('section') ?? el.closest('article')
|
||||
if (container) container.remove()
|
||||
})
|
||||
const article = new Readability(doc).parse();
|
||||
if (!article) {
|
||||
showMessageForXSeconds('Could not extract readable content.', 5)
|
||||
|
||||
Reference in New Issue
Block a user