Prevent loading web pages when a descendant of a link is clicked in a conversation.
This commit is contained in:
Родитель
685755821a
Коммит
f7b20870e7
|
@ -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);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче