Skip to content

Commit

Permalink
Fix postMessage origin error in produciton (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
MAX-786 authored Jun 29, 2024
1 parent 7a32cec commit d87c10e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/volto-hydra/src/components/Iframe/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,9 @@ const Iframe = (props) => {
useEffect(() => {
if (form && Object.keys(form).length > 0 && isValidUrl(src)) {
// Send the form data to the iframe
const origin = new URL(src).origin;
document
.getElementById('previewIframe')
.contentWindow.postMessage({ type: 'FORM', data: form }, origin);
.contentWindow.postMessage({ type: 'FORM', data: form }, '*');
}
}, [form, initialUrl, src]);

Expand Down

0 comments on commit d87c10e

Please sign in to comment.