From f7b20870e7f6bb843f140c9a99554eb7405adafd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Qu=C3=A8ze?= Date: Tue, 12 Jul 2011 18:52:01 +0200 Subject: [PATCH] Prevent loading web pages when a descendant of a link is clicked in a conversation. --- im/content/convbrowser.xml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/im/content/convbrowser.xml b/im/content/convbrowser.xml index de6319ad07..4afc2f61e4 100644 --- a/im/content/convbrowser.xml +++ b/im/content/convbrowser.xml @@ -810,7 +810,15 @@ // The 'click' event is fired even when the link is // activated with the keyboard. - let url = event.target.href; + // The event target may be a descendant of the actual link. + let url; + for (let elem = event.target; elem; elem = elem.parentNode) { + if (elem instanceof HTMLAnchorElement) { + url = elem.href; + if (url) + break; + } + } if (url !== undefined) { let uri = Services.io.newURI(url, null, null);