I was considering creating an extension to hide specific Mastodon posts. Let's say I’m afraid of snakes and want to make sure I can hide any post with a pic of a snake in it (I'm already filtering by the word).
- Each post has a
data-idby which it can be styled. - For a one-off, that's all I need, I can hide it with Javascript
- But to make the change persistent, I would need to have a CSS injected with
display:nonefor all the posts I’ve hidden (or a<style>element in the DOM?) - So I would need to have an extension which could add a line to a CSS file, or which would pull the CSS dynamically from a database, or write out a new local file from a database when a new post was hidden
Which of those things is even possible? Can an extension rewrite its own files?