hide-if-contains-visible-text
The hide-if-contains-visible-text snippet hides any HTML element that matches a CSS selector if the element's visible text content contains a given string. It can check CSS attributes to locate a string even when a website employs methods to obscure the text.
Parameters
|
Name |
Description |
Mandatory |
|---|---|---|
|
search |
The string to match against visible text. Enclose in |
Yes |
|
selector |
The CSS selector that an HTML element must match to be hidden. |
Yes |
|
searchSelector |
CSS selector for elements containing the string. Defaults to |
No |
|
optionalParameters |
CSS attributes a computed style map should have to consider a node hidden. Syntax: |
No |
Default parameters
|
Name |
Description |
Default Value |
|---|---|---|
|
|
Event to wait for before executing. |
|
|
|
Disable the font visibility check. |
|
|
|
Expand bounding box of overflow parent (pixels). |
|
|
|
Disable check for same text/background color. |
|
|
|
Categorize elements pushed outside a parent. |
|
|
|
Check for transparent gibberish text. |
|
|
|
Check for zero-size gibberish text. |
|
|
|
Check for same-color gibberish text. |
|
Filter examples
|
Filter |
Result |
|---|---|
|
|
Hides any |
|
|
Hides |
|
|
Hides matching list items. |
|
|
Hides items whose font color is not white. |