To set up a warning message when visiting an external link, you can follow these steps.
#1. Use this code to Code Injection > Footer (or Page Header Injection, if you want to do this on specific page only)
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$('a').on('click', function() {
if ( this.host !== window.location.host ) {
var thisHrefHere = this.href;
if ( window.confirm("Hey! Warning. U Click another url: "+thisHrefHere+"") ) {
console.log('Click true and redirecting');
}else {
console.log('Click false and no redirect');
return false;
}
}
});
});
</script>
#2. Result
#3. To customize the text in warning message, you can adjust this line.