Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use css :has() selector instead of JS detection #123

Merged
merged 9 commits into from
Jan 17, 2024

Conversation

theRealPadster
Copy link
Owner

@theRealPadster theRealPadster commented Jan 17, 2024

This PR replaces the javascript that's used to detect podcast and audiobook elements with CSS, using the :has() selector. This makes it much more reliable because it will apply to the entire page at all times, whereas I was using a hacky MutationObserver method to try and catch elements as they loaded onto the page.

As a result, the tagPodcasts() and tagAudioBooks() functions don't do anything any more, but I am leaving the original "listen to page navigation and re-apply when DOM is ready" code in place, in case I need to use it again in the future.

I've also blocked some more podcast-related categories on the search page.

@theRealPadster theRealPadster merged commit fa399de into main Jan 17, 2024
2 checks passed
@theRealPadster theRealPadster deleted the feat/use-css branch January 17, 2024 03:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant