postmessage Questions

5

Solved

Window.postMessage() has a targetOrigin parameter that can be set to a URI (to ensure the message reaches only a specific url). It can also be set to * of course (not recommended), but is there a w...
Airless asked 11/3, 2016 at 12:2

8

Solved

I have multiple iframes in a page. Now I have one message event listener for the page, which gets the messages from all of the iframes. I have a workaround to know from which iframe the message is ...
Terraterrace asked 28/4, 2013 at 18:52

3

Solved

I'm trying to call parent.postMessage(obj, 'whatever'); from within an iframe and I'm getting this error: Uncaught DOMException: Failed to execute 'postMessage' on 'Window': An object could not...
Bleier asked 21/2, 2017 at 19:40

2

I need to pass large blobs of data between the main page and embedded iframes. In order to avoid [de]serialization overhead, I would love to pass ArrayBuffer with postMessage() and instantiate view...
Accouter asked 24/10, 2017 at 12:50

3

My application with the fake url just for our understanding www.myapp.com needs to spawn a popup window at the fake url www.myredirect.com. Once reached www.myredirect.com the page is automatically...
Varix asked 19/12, 2023 at 9:32

5

Solved

I don't know what to do. I tried several sample codes from different sources, I tried them in different browsers (from Chrome 9 to FF 4), and still nothing seems to be working with the "postMessage...
Protean asked 20/6, 2011 at 13:18

3

I am facing a problem with decode() on SharedArrayBuffer. Code: var sharedArrayBuffer = new SharedArrayBuffer(2); var uint8Array = new Uint8Array(sharedArrayBuffer); uint8Array[0] = 20; var dec...

4

Assume I have several iframes on the page and one of them sent a post message. Is there a simple and crossbrowser way to detect which one did it and be able to reply? I see the source property of ...
Microorganism asked 2/10, 2013 at 9:55

4

Solved

I try to postMessage between a web application and the corresponding service worker. The service worker is successfully registered and working so far. Unfortunately, I noticed some strange behavior...
Skiba asked 11/5, 2015 at 21:15

2

I have some code my React project which listens to a message event. const onMessage = ({ data }) => { console.log('On onMessage has been fired'); } window.addEventListener('message', onMessage...
Hudnall asked 12/8, 2021 at 11:5

2

Is there a chance to use window.postmessage() to communicate between two different applications in different tabs in the same browser? I know you can do it between application and iFrame, but how ...
Bassinet asked 12/8, 2014 at 18:10

3

Solved

I use a few lines of javascript to create an iframe element, and then I'd like to send it a message, like this: function loadiframe (callback) { var body = document.getElementsByTagName('body')[0...
Julenejulep asked 17/5, 2011 at 11:43

5

I usually use the HTML5 PostMessage API to communicate information from my iframed content to the parent frame. Recently I've had my content used inside an Android WebView (as far as I can tell thi...
Denmark asked 3/10, 2013 at 16:19

3

Say I have two tabs, each with a web-page loaded on a different domain. The pages in the two tabs want to communicate. The simplest solution I could see was this one (my answer on a closely-relate...
Malines asked 1/12, 2014 at 18:10

3

I'm having an issue communicating from my parent window to the child iFrame. But in the other side, everything works perfectly. Here is how I get the chil iFrame object in order to fire the postMe...
Mesopause asked 6/12, 2016 at 8:42

1

Solved

How is window.postMessage different from window.chrome.webview.postMessage? I'm using it in the context of a WebView2 (in a .NET/WPF application). We are loading a third-party webpage in WebView2. ...
Fishback asked 24/8, 2021 at 13:12

1

I'm trying to load a react url as an iframe in my jsp project. Here my sender side code block: <iframe id="eda" style="display: none;" src="http://myhost:3000/" width="100%" height="600" b...
Weismann asked 29/3, 2019 at 6:24

2

Solved

I have been stuck on this for hours. I have a.html on http://example.com that contains an iframe with src to b.html on http://subdomain.example.com. a.html has some JS code to postMessage to the ...
Melgar asked 28/9, 2012 at 13:39

1

I am trying to post a message to an iFrame within my angular application. The message makes it to the iFrame; however, the data passed is always received as an empty string in the iFrame. Any idea...
Hollowell asked 21/3, 2020 at 6:18

5

Solved

I want to periodically call an API from my service worker to send data stored in the localStorage. This data will be produced and saved in localStorage when a user browses my website. Consider it s...

3

I'm trying to implement communication with postMessage. There is the main page which opens a popup with an iframe which comes from a different domain. This works fine so far but I want to catch the...
Synonymy asked 27/5, 2014 at 7:27

1

Solved

my goal is to integrate a flutter widget with the help of an iframe on my main page. The main page is not written in flutter. However, I need an interface through which the main page can communicat...
Cwmbran asked 5/2, 2021 at 11:18

2

I have the iframe: <iframe id="GameFrame" sandbox="allow-scripts allow-pointer-lock" src="https://127.0.0.1:112/games/1047/play"> </iframe> My parent page is located at: https://1...
Unhand asked 28/4, 2015 at 11:35

1

Solved

I'm creating a react app that I want my users to embed on their websites. This app will be shown in two iframes but I want to only show one iframe at a time. So one part of the app would be a simpl...
Chrysa asked 6/8, 2020 at 18:7

3

Solved

The following JavaScript code uses the HTML5 postMessage / addEventListener functions to send a message to itself: window.addEventListener('testMsg', function(event) { alert('got a message'); /* ...
Slaver asked 21/7, 2013 at 18:11

© 2022 - 2025 — McMap. All rights reserved.