mirror of
https://github.com/gorhill/uBlock.git
synced 2026-03-11 09:04:36 +00:00
Fix potential exception in procedural operator :matches-attr
Related issue: https://github.com/uBlockOrigin/uBlock-issues/issues/3720
This commit is contained in:
parent
bb9e2c0fc7
commit
e07e7bbd09
2 changed files with 2 additions and 0 deletions
|
|
@ -119,6 +119,7 @@ class PSelectorMatchesAttrTask extends PSelectorTask {
|
|||
this.reValue = regexFromString(task[1].value, true);
|
||||
}
|
||||
transpose(node, output) {
|
||||
if ( typeof node.getAttributeNames !== 'function' ) { return; }
|
||||
const attrs = node.getAttributeNames();
|
||||
for ( const attr of attrs ) {
|
||||
if ( this.reAttr.test(attr) === false ) { continue; }
|
||||
|
|
|
|||
|
|
@ -99,6 +99,7 @@ class PSelectorMatchesAttrTask extends PSelectorTask {
|
|||
this.reValue = regexFromString(task[1].value, true);
|
||||
}
|
||||
transpose(node, output) {
|
||||
if ( typeof node.getAttributeNames !== 'function' ) { return; }
|
||||
const attrs = node.getAttributeNames();
|
||||
for ( const attr of attrs ) {
|
||||
if ( this.reAttr.test(attr) === false ) { continue; }
|
||||
|
|
|
|||
Loading…
Reference in a new issue