main
Eloy Lafuente (stronk7) 2019-04-17 00:49:21 +02:00
commit 079697de89
1 changed files with 4 additions and 3 deletions

View File

@ -239,10 +239,11 @@
// Find all the Aria labels that contain this text.
var exactLabelMatches = [];
var anyLabelMatches = [];
findPossibleMatches('//*[@aria-label and contains(@aria-label, "' + escapedText +
'")]', function(match) {
findPossibleMatches('//*[@aria-label and contains(@aria-label, "' + escapedText + '")]' +
'| //img[@alt and contains(@alt, "' + escapedText + '")]', function(match) {
// Add to array depending on if it's an exact or partial match.
if (match.getAttribute('aria-label').trim() === text) {
var attributeData = match.getAttribute('aria-label') || match.getAttribute('alt');
if (attributeData.trim() === text) {
exactLabelMatches.push(match);
} else {
anyLabelMatches.push(match);