1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 13:47:57 +01:00

Remove some duplication from buffer.followDocumentRelationship.

This commit is contained in:
Doug Kearns
2009-02-19 23:41:32 +11:00
parent 600f80a968
commit 22200fc282

View File

@@ -1079,13 +1079,7 @@ function Buffer() //{{{
for (let i in util.range(res.snapshotLength, 0, -1)) for (let i in util.range(res.snapshotLength, 0, -1))
{ {
let elem = res.snapshotItem(i); let elem = res.snapshotItem(i);
if (regex.test(elem.textContent)) if (regex.test(elem.textContent) || Array.some(elem.childNodes, function (child) regex.test(child.alt)))
{
buffer.followLink(elem, liberator.CURRENT_TAB);
return true;
}
// images with alt text being href
if (Array.some(elem.childNodes, function (child) regex.test(child.alt)))
{ {
buffer.followLink(elem, liberator.CURRENT_TAB); buffer.followLink(elem, liberator.CURRENT_TAB);
return true; return true;