| ▲ | Klaster_1 7 hours ago | |||||||||||||||||||||||||||||||||||||
I used this approach before and it indeed works better than the 2010-style jQuery mess. A good fit for userscripts too, where the problem you attempt to solve is fairly limited and having dependencies, especially with a build steps, is a pain. Note that you don't need jQuery for this at all, unless you are somehow stuck with ancient browser support as a requirement - querySelector, addEventListener, innerHtml - the basic building blocks of the approach - have been available and stable for a long time. | ||||||||||||||||||||||||||||||||||||||
| ▲ | doix 7 hours ago | parent [-] | |||||||||||||||||||||||||||||||||||||
Unfortunately, nowadays writing userscripts is much harder than it used to be. Most websites are using some sort of reactive FE framework so you need to make extensive use of mutationObservers (or whatever the equivalent is in jQuery I guess). | ||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||