Is there any way to capture user click on link then use location.replace to redirect it?