Feature #81939
openAllow right click and copy for spam protected email addresses
0%
Description
Currently, if someone right clicks and copies a spam protected email address, they get javascript:linkTo_UnCryptMailto('sdfgserwhatevereteggh');
For email where the link text is not the address, I could see those who don't use an email client being unsure of how to get the address.
What I've experimented with is triggering a function on opening the context menu, to replace the href contents with the correct email.
Example here: https://jsfiddle.net/nhaskins/1nk7ky75/2/
I've tested this in TYPO3 by adding the following function to typo3/sysext/frontend/Classes/Page/PageGenerator.php at line 756 (end of $scriptJsCode)
function UnCryptMailto(el) {
var str = el.getAttribute("href").split("\'")[1];
el.setAttribute("href", decryptString(str,' . $tsfe->spamProtectEmailAddresses * -1 . '));
el.removeAttribute("oncontextmenu");
}
and the following in typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php at line 5646 (just before $tagAttributes = [];)
if ($tsfe->spamProtectEmailAddresses) {
$finalTagParts['aTagParams'] .= ' oncontextmenu="UnCryptMailto(this)"';
}
I'm pretty sure this isn't the best way to include the oncontextmenu attribute, and it looks like it would need to be added to at least the f:link.email viewhelper as well.
Updated by Riccardo De Contardi over 4 years ago
As far as I have understood, this feature is covered by the third-party extensione emailobfuscator
Updated by Gerrit Code Review over 1 year ago
- Status changed from New to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/79068
Updated by Benni Mack over 1 year ago
- Related to Bug #101228: Mailto link decryption vs. manipulated DOM added
Updated by Riccardo De Contardi 7 months ago
- Related to Story #94904: Is spamProtectEmailAddresses still worth keeping around? added