Commit ec081a3
Fix cross-origin-frame-redact watcher missing top-level iframes
The watcher's onSubtrees handed each added subtree root to scan(), which
calls querySelectorAll('iframe') on it. querySelectorAll matches
descendants only, so a bare cross-origin <iframe> appended directly to
document.body slipped past the watcher (the iframe itself is the root,
and it has no iframe descendants).
Mirror the workaround already documented in selector-hide-rule.ts: drop
the per-root loop and rescan from document.body on every batch. The
is-connected / is-revealed checks in scan() keep it idempotent, and the
watcher's throttle coalesces bursts.
Add a regression test that appends a bare iframe directly to body.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>1 parent a158f60 commit ec081a3
2 files changed
Lines changed: 25 additions & 4 deletions
Lines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
192 | 210 | | |
193 | 211 | | |
194 | 212 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
84 | 87 | | |
85 | 88 | | |
86 | 89 | | |
| |||
0 commit comments