Commit cf9ad96
committed
Use iframe's actual origin for postMessage instead of hardcoded value
Previously hardcoded 'https://listen.libbyapp.com' as target origin,
but Libby uses dynamic subdomains (e.g., dewey-abc123.listen.libbyapp.com).
This caused postMessage to fail with origin mismatch error.
- Extract actual origin from iframe.src URL
- Fall back to base domain if URL parsing fails
- Add console logging for debugging
- Fixes: "The target origin provided does not match the recipient window's origin"1 parent ed39da6 commit cf9ad96
1 file changed
Lines changed: 11 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
324 | 324 | | |
325 | 325 | | |
326 | 326 | | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
327 | 337 | | |
328 | 338 | | |
329 | 339 | | |
330 | 340 | | |
331 | | - | |
| 341 | + | |
332 | 342 | | |
333 | 343 | | |
334 | 344 | | |
| |||
0 commit comments