We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
My parent Vue:
<vue-friendly-iframe :style="{ 'display' : iframeLoading ? 'none' : 'block' }" :src="example1Form.src " @load="onLoad" @iframe-load="onIframeLoad" @document-load="onDocumentLoad" frameborder="0" gesture="media" allow="encrypted-media" allowfullscreen="allowfullscreen" width="100%" ref="friendlyIframe" >
My parent send post message function:
sendPostMessage() { this.$refs.friendlyIframe.iframeEl.contentWindow.postMessage("message"); }
My Iframe (Html):
<script> window.addEventListener("message", function (event) { alert() <---------- not working }, false); </script>
The text was updated successfully, but these errors were encountered:
I think you need to provide the targetOrigin argument when calling window.postMessage()
targetOrigin
window.postMessage()
https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage#Syntax
this.$refs.friendlyIframe.iframeEl.contentWindow.postMessage("message", "*"); //note the *
this.$refs.friendlyIframe.iframeEl.contentWindow.postMessage("message", "*");
Sorry, something went wrong.
No branches or pull requests
My parent Vue:
My parent send post message function:
My Iframe (Html):
The text was updated successfully, but these errors were encountered: