|
|
|
|
|
by kgwxd
2307 days ago
|
|
I made a Firefox addon for myself that applies CSS to elements with text and/or attribute values that match a given regular expression. One of the first issues I ran into was that a lot of pages build their content via javascript so I added a delay to the scan. That mostly worked but the next issue (obvious in hindsight) was that can happen at any time, multiple times, for various reasons. That's when I learned about MutationObserver for the first time and it's worked pretty much perfectly since. Here's the addon source [0]. I mostly (only) use the addon to style elements with links to sites I know I never want to visit, but it should work for this type of thing. However, the current UI isn't convenient for adding an adhoc rule. [0] https://github.com/7w0/ssure/blob/4fd34677ad1c3f667ae85b939f... |
|