Page Extractor Does Not Correctly Filter Hidden Nodes
Categories
(Core :: Machine Learning: On Device, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox146 | --- | fixed |
People
(Reporter: nordzilla, Assigned: nordzilla)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 2 external files)
|
2.11 KB,
text/html
|
Details |
Description
I have noticed, when using the page extractor for Translations language identification, that there are cases where invisible page content is extracted when it otherwise should not be.
Steps to Reproduce
-
Open the test page attached to this bug.
-
Open the Browser Console.
-
Run the following JS code:
await gBrowser.selectedBrowser.browsingContext.currentWindowGlobal.getActor("PageExtractor").getText();
Expected Results
The extracted text matches only the visible text on the test page.
Actual Results
The extracted text contains text within the HTML that is not visible on the page.
| Assignee | ||
Comment 1•1 year ago
|
||
This patch updates the page extraction algorithm to consider whether
all encountered nodes are hidden, rather tha only HTML elements.
This improves the overall extraction algorithm, ensuring that only
page text that is truly visible to the user is extracted.
| Assignee | ||
Comment 2•1 year ago
|
||
This improves the page extraction algorithm to consider nodes
with a zero-sized bounding client rect to be hidden on the page.
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Comment 4•1 year ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/764c5684db9a
https://hg.mozilla.org/mozilla-central/rev/f332863401a3
Updated•1 year ago
|
Description
•