4 ms·
For 1, try this quick-and-dirty fix: document.querySelectorAll('.book-preview-body').forEach((e, i) => { let title = e.querySelector('h2').innerText.toLowerC
by mkl 3y ago
For 1, try this quick-and-dirty fix:
document.querySelectorAll('.book-preview-body').forEach((e, i) => { let title = e.querySelector('h2').innerText.toLowerCase().replace(/ /g, '-'); let button = e.querySelector('button'); button.innerHTML = `<a href="/book/${title}">Learn more</a>`; })
I'm guessing the link from the title, which may not always be accurate (e.g. for non-unique titles). The actual link isn't loaded until the button's modal is displayed - a more foolproof way to do it would be to load the modal's data (it's in a nearby div's hx-get attribute) and get the proper URL from that.
For sites I use regularly that have problematic UIs like this, I write TamperMonkey userscripts (yes, I have quite a lot of them at this point).