I can't understand why this code doesn't work in chrome with tampermonkey:
window.addEventListener('click', event => {
const el = event.target.closest('[href*="forums/topic"]');
const el2 = event.target.closest('[href*="?do=getNewComment"]');
const href = el && el.getAttribute('href');
if (el && (!el2)) {
el.setAttribute('href', decodeURIComponent(href + '?do=getNewComment'));
}
}, true);
it works fine on firefox and greasemonkey
Comments
Post a Comment