mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 12:07:59 +01:00
Remove some duplication from buffer.followDocumentRelationship.
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user