From 47b985a0563d8e75420ff89de65c6ab45fb0b01b Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Thu, 20 Jun 2024 09:21:43 -0400 Subject: [PATCH] Fix `:matches-prop()` operator when no value provided --- src/js/contentscript-extra.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/js/contentscript-extra.js b/src/js/contentscript-extra.js index 4d10bb878..21feb1d39 100644 --- a/src/js/contentscript-extra.js +++ b/src/js/contentscript-extra.js @@ -188,7 +188,11 @@ class PSelectorMatchesPropTask extends PSelectorTask { if ( value === null ) { return; } value = value[prop]; } - if ( this.reValue !== null && this.reValue.test(value) === false ) { return; } + if ( this.reValue === null ) { + if ( value === undefined ) { return; } + } else if ( this.reValue.test(value) === false ) { + return; + } output.push(node); } }