Commit 7609660
fix(openapi-resource-mocks): sanitize FormData/File/Blob args before DOM dispatch
CustomEvent.detail is cloned via structured clone when crossing Chrome Extension
isolated worlds. FormData (and File/Blob) cannot be cloned across that boundary,
causing detail to arrive as null in the content script and throwing on destructure.
Sanitize non-cloneable args to descriptive strings in dispatchDomEvent (in-page
history retains originals for getHistory()). Also add a null guard in the content
script as a safety net for any future uncloneable type.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent c9537a2 commit 7609660
2 files changed
Lines changed: 21 additions & 2 deletions
File tree
- tools
- openapi-resource-devtools/src/content
- openapi-resource-mocks/src/lib
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
18 | 22 | | |
19 | 23 | | |
20 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
123 | 138 | | |
124 | 139 | | |
125 | 140 | | |
126 | | - | |
| 141 | + | |
127 | 142 | | |
128 | 143 | | |
129 | 144 | | |
| |||
0 commit comments