Skip to content
This repository has been archived by the owner on Apr 3, 2022. It is now read-only.

"MegaPost" not blocked #9

Open
Drag13 opened this issue Dec 25, 2020 · 1 comment
Open

"MegaPost" not blocked #9

Drag13 opened this issue Dec 25, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@Drag13
Copy link
Owner

Drag13 commented Dec 25, 2020

If post is mega-post - it will not be blocked

image

See

$('.post .preview-data__head a')[0].href
@Drag13 Drag13 added the bug Something isn't working label Mar 8, 2021
@Drag13
Copy link
Owner Author

Drag13 commented Mar 8, 2021

  • Switch from article to .post selectors

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}`)
        );
    }

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant