From 4141953ceed9ba7af2b645ae45b089d0c8a76a50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Bellegarde?= Date: Sat, 14 Oct 2023 18:39:05 +0200 Subject: [PATCH] ui: Replace anchors title if looks like an URI Fix #1567 --- ui/conversation-web-view.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ui/conversation-web-view.js b/ui/conversation-web-view.js index 7b3a1c89..e45ee6c6 100644 --- a/ui/conversation-web-view.js +++ b/ui/conversation-web-view.js @@ -59,6 +59,7 @@ ConversationPageState.prototype = { this.updateDirection(); this.createControllableQuotes(); this.wrapSignature(); + this.deceptiveLinksTitle(); PageState.prototype.loaded.apply(this, []); }, /** @@ -151,6 +152,15 @@ ConversationPageState.prototype = { } } }, + deceptiveLinksTitle: function() { + let pattern = /^((http|https|ftp):\/\/)/; + let anchors = document.getElementsByTagName("a"); + for (var i = 0; i < anchors.length; i++) { + if(pattern.test(anchors[i].title)) { + anchors[i].title = anchors[i].href; + } + } + }, /** * Look for and wrap a signature. *