How to splice parameters when clicking a hyperlink and opening a new page

"" `<a href="https://www.tmall.com"></a>`"" URL`https://www.tmall.com/?spm=a21bo.2017.201859.1.5af911d91CQQ6r`spm

spm-sharp-sharp-sharp 

Apr.01,2022

is just an event that modifies the link when you click. You can try to right-click and you will see that the link has changed

how to implement:
1. Intercept native links
2. Splicing parameters

.onclick = function (e) {
    if ( e && e.preventDefault ) {    
        e.preventDefault();
        window.location.href = e.target.getAttribute('href') + '?v=1'
    }
}

should have listened to the click event of this tag, then processed it, and then redirected it.

Menu