Prevent loading web pages when a descendant of a link is clicked in a conversation.

This commit is contained in:
Florian Quèze 2011-07-12 18:52:01 +02:00
Родитель 685755821a
Коммит f7b20870e7
1 изменённых файлов: 9 добавлений и 1 удалений

Просмотреть файл

@ -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);