Last active
March 26, 2019 18:40
-
-
Save iamandrewluca/de37df5c5b8854f03720d97a154dfae2 to your computer and use it in GitHub Desktop.
Will prompt to confirm mailto links.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Array.from(document.querySelectorAll('[href^="mailto:"]')).forEach(a => { | |
a.addEventListener('click', function(e) { | |
if (!confirm('Are you sure?')) { | |
e.preventDefault() | |
} | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment