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.
|
// taz "Mehr zum Thema" related-articles teaser section.
|
||||||
doc.querySelectorAll('#articleTeaser').forEach(el => el.remove())
|
doc.querySelectorAll('#articleTeaser').forEach(el => el.remove())
|
||||||
// taz subsidiary magazine promo blocks (e.g. taz FUTURZWEI): the promo
|
// taz subsidiary magazine promo blocks (e.g. taz FUTURZWEI): either the
|
||||||
// <article> carries an aria-label containing "Abo".
|
// <article> itself or its direct <a> child carries an aria-label containing "Abo".
|
||||||
doc.querySelectorAll('article[aria-label*="Abo"]').forEach(el => {
|
doc.querySelectorAll('article[aria-label*="Abo"]').forEach(el => {
|
||||||
const container = el.closest('section') ?? el
|
const container = el.closest('section') ?? el
|
||||||
container.remove()
|
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();
|
const article = new Readability(doc).parse();
|
||||||
if (!article) {
|
if (!article) {
|
||||||
showMessageForXSeconds('Could not extract readable content.', 5)
|
showMessageForXSeconds('Could not extract readable content.', 5)
|
||||||
|
|||||||
Reference in New Issue
Block a user