Open davidp88 opened 1 year ago
It also finds occurrences that are hidden by CSS. Sometimes this can also be an advantage.
Showing matches that are hidden by Css is not correct,pls exclude matches that are hidden by css
Who said so?
The two extra occurrences are from the navbar, which have a visibility: hidden
style applied to them. In the extensions plugin scripts, isHiddenElement doesn't account for this. Should be an easy fix.
There are many other ways to hide elements from visibility. E.g. this often used class to show elements only to screenreaders from Contao CMS
.invisible {
border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
}
or this from Bootstrap
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
}
But there are many others
Element {
overflow: hidden;
text-indent: 100%;
}
Element {
position: absolute;
z-index: -1;
}
Element {
position: absolute;
left: -10000px;
}
Element {
height: 0;
overflow: hidden;
}
And more ...
You can find many approaches on the web to find out whether the visitor sees an element or rather a text or not. I think they can all fail somehow. So this ticket is definitely not a bug.
You have to turn CSS off, to see everything.
Chrome's built-in search also matches text in some types of hidden nodes, e.g. on this page (desktop), a search for quote
will find an "invisible" occurrence, inside the tooltip for the quote button. The tooltip uses the same .sr-only
CSS @Aybee shared above.
Open this site- https://www.gpsoft.com.au/program/program.html and search for "opus",there are only 14 matches for opus but find shows 16 matches found.Even firefox says 14 matches only.