A while ago I made a bookmark add-on which could be used to do something similar. But it sunk without a trace on HN. Posting it here as readers probably already interested in bookmark related stuff...
for what it's worth i think it's pretty cool. if i understand right i can use it for example to change all links from dead site to archive.org, or from youtube.com to my favorite invidious instance.
(i also echo your sentiment that JS is deeply flawed :))
https://defaultcharacter.com/2021-09-bookmark-controller-int...