HabrSanitizer
HabrSanitizer copied to clipboard
"MegaPost" not blocked
If post is mega-post - it will not be blocked

See
$('.post .preview-data__head a')[0].href
- Switch from
articleto.postselectors
visibleArticle: article:not(.${hiddenArticleClassName}),
Rework the check method:
function belongsToBlog(article, blogName) {
if (article == null) {
return false;
}
const href = article.querySelector(selectors.company)?.href?.toLowerCase() ?? '';
const megaPostHref = article.querySelector(selectors.mega_post)?.href?.toLowerCase() ?? '';
return [href, megaPostHref].some(
(link) => link.endsWith(`/company/${blogName}/`) || link.endsWith(`/company/${blogName}`)
);
}