Available since v0.1.0
fs-trigger="load"
StableFires on the native load event of media elements. Use for image, video, or iframe load validation.
Syntax
<img src="/hero.webp"
fs-assert="home/hero-loaded"
fs-trigger="load"
fs-assert-loaded="img.hero">
When to use it
- Hero image load validation
- Video or iframe loaded-successfully contracts
- Anything where "did the resource actually fetch?" is a visible correctness signal
Example
<video src="/demo.mp4" controls
fs-assert="demo/video-loaded"
fs-trigger="load"
fs-assert-loaded="video">
</video>
Pairs well with
fs-assert-loaded— the natural partner for this trigger- Conditional assertions — pair with
errorfor success/failure branches
Gotchas
- Cached resources. Browsers fire
loadsynchronously for cached resources. If the image is in cache when the agent initializes, the event may fire before the assertion is registered. Preferfs-assert-loadedwhich also checks.completefor the cached case. - iframe
loadis noisy. Every navigation inside the iframe fires anotherload. Scope the assertion key appropriately.
See also
error— the failure counterpartfs-assert-loaded- Triggers index