Problem
Browser performance/debug rigs repeatedly need the same DOM lifecycle timings, but each workload currently writes custom observer code. That makes metrics inconsistent and easy to break when observers run before the document root exists or when elements are replaced during hydration.
Proposal
Add reusable DOM lifecycle observer helpers that can be installed before page scripts and reported in browser artifacts.
Suggested metrics per observed selector/id:
first_seen_ms
first_visible_ms
first_child_ms
first_iframe_ms
first_visible_iframe_ms
first_button_ms
first_visible_button_ms
stable_visible_ms
removed_count
peak_child_count
peak_iframe_count
peak_visible_iframe_count
peak_button_count
peak_visible_button_count
final_child_count
final_iframe_count
final_visible_iframe_count
final_button_count
final_visible_button_count
Requirements
- Safe to install before
document.documentElement exists.
- Records metrics relative to the same clock used by browser probe artifacts.
- Handles elements appearing, disappearing, and being replaced.
- Can observe one or more selectors in the same run.
- Does not contain product-specific assumptions about WooCommerce, Stripe, wallets, or payment buttons.
Acceptance criteria
- Browser artifacts include lifecycle metrics for configured selectors.
- A smoke test covers an element that appears after page load.
- A smoke test covers observer installation before
document.documentElement is available.
- Existing probes without observers remain unchanged.
Problem
Browser performance/debug rigs repeatedly need the same DOM lifecycle timings, but each workload currently writes custom observer code. That makes metrics inconsistent and easy to break when observers run before the document root exists or when elements are replaced during hydration.
Proposal
Add reusable DOM lifecycle observer helpers that can be installed before page scripts and reported in browser artifacts.
Suggested metrics per observed selector/id:
first_seen_msfirst_visible_msfirst_child_msfirst_iframe_msfirst_visible_iframe_msfirst_button_msfirst_visible_button_msstable_visible_msremoved_countpeak_child_countpeak_iframe_countpeak_visible_iframe_countpeak_button_countpeak_visible_button_countfinal_child_countfinal_iframe_countfinal_visible_iframe_countfinal_button_countfinal_visible_button_countRequirements
document.documentElementexists.Acceptance criteria
document.documentElementis available.