I'm looking for a browser addon, userscript or some simple way that would display the URL of a link on the mouse position instead of the bottom left corner, like this for example.
Edit: It was easier than I thought, got it working with an one line userscript.
https://jsfiddle.net/0b819fx4/
var tooltipSpan = document.querySelectorAll('a').forEach(a => a.title = a.href);
Not sure exactly whats your requirement but seems you are looking for some title. Can you try with this:
<a title="https://i.sstatic.net/Lof5u.png" href="https://i.sstatic.net/Lof5u.png">this</a>
This will show a popup when you hover over the anchor tab.