hide-if-matches-xpath3
Last updated
Was this helpful?
Last updated
Was this helpful?
The hide-if-matches-xpath3
hides a specific element through a XPath 3.1 query string.
query
The XPath query that targets the element to hide.
Yes
scopeQuery
XPath selector that the filter devs can use to restrict the scope of the Mutation Observer. It is important that the selector is as specific as possible to avoid to match too many nodes.
No
The following table lists examples that use the hide-if-matches-xpath3
snippet:
hide-if-matches-xpath3 '//*[@id="sponsored"]'
Hides all elements withid="sponsored"
.
hide-if-matches-xpath3 '//*[lower-case(text())="sponsored"]'
Hides any element that contains the text "sponsored" in its text content, regardless of the element type or the case (upper or lower) of the text (e.g.: "sPoNSoReD").
hide-if-matches-xpath3 '//div and matches(@class,"Spon(.+)sored")]'
Hides all divs with a class containing a value that matches the regular expression pattern "Spon(.+)sored" (e.g.: "Spon12345sored").