https://github.com/knowler/hidden-until-found-polyfill
A work in progress polyfill for the `hidden=until-found` HTML feature
https://github.com/knowler/hidden-until-found-polyfill
Last synced: 4 months ago
JSON representation
A work in progress polyfill for the `hidden=until-found` HTML feature
- Host: GitHub
- URL: https://github.com/knowler/hidden-until-found-polyfill
- Owner: knowler
- Created: 2024-12-28T20:48:24.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-03T06:13:41.000Z (over 1 year ago)
- Last Synced: 2025-10-19T18:41:32.376Z (8 months ago)
- Language: JavaScript
- Homepage:
- Size: 17.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# `hidden=until-found` polyfill
This is a work-in-progress polyfill for the `hidden=until-found` feature which
will hide content until it’s found (i.e. usually via “find in page” browser
features). This only works in Firefox as there’s no way to detect find-in-page
activity in Safari. Chrome already supports the feature, so we don’t polyfill
it.
## Usage
The script should be loaded before any body content to ensure the mutation
observer picks up elements as they are added to the DOM.
```html
Hello, World!
```
## Limitations
- Does not work inside of shadow roots.
- Polyfilling declarative shadow DOM is heavy (i.e. you need to walk every
element) and selection changes inside the shadow DOM are complicated in
Firefox.
- Does not work in Safari.
- So, this is really only relevant for Firefox at this point.