Fixes no rel noopener when properties of anchor element cannot be resolved anymore (#1818)
* Fixes no rel noopener when anchor element is not available anymore. #1802 * Change rellnoopener to getAttribute('href')
This commit is contained in:
Родитель
07b8d3f16f
Коммит
91ad83a37c
|
@ -39,9 +39,11 @@ module.exports = [
|
|||
},
|
||||
'external-anchors-use-rel-noopener': {
|
||||
score: false,
|
||||
debugString: 'Lighthouse was unable to determine the destination of some anchor tags. ' +
|
||||
'If they are not used as hyperlinks, consider removing the _blank target.',
|
||||
extendedInfo: {
|
||||
value: {
|
||||
length: 2
|
||||
length: 3
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -494,7 +494,7 @@ class Driver {
|
|||
* @return {!Promise<string>} The property value, or null, if property not found
|
||||
*/
|
||||
getObjectProperty(objectId, propName) {
|
||||
return new Promise((resolve, reject) => {
|
||||
return new Promise(resolve => {
|
||||
this.sendCommand('Runtime.getProperties', {
|
||||
objectId,
|
||||
accessorPropertiesOnly: true,
|
||||
|
@ -508,7 +508,7 @@ class Driver {
|
|||
if (propertyForName) {
|
||||
resolve(propertyForName.value.value);
|
||||
} else {
|
||||
reject(null);
|
||||
resolve(null);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
@ -29,7 +29,7 @@ class AnchorsWithNoRelNoopener extends Gatherer {
|
|||
.then(failingNodeList => {
|
||||
const failingNodes = failingNodeList.map(node => {
|
||||
return Promise.all([
|
||||
node.getProperty('href'),
|
||||
node.getAttribute('href'),
|
||||
node.getAttribute('rel'),
|
||||
node.getAttribute('target')
|
||||
]);
|
||||
|
|
|
@ -43,6 +43,7 @@ class Element {
|
|||
if (attrIndex === -1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return resp.attributes[attrIndex + 1];
|
||||
});
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче