Questions tagged [postmessage]

The window.postMessage() method safely enables cross-origin communication between Window objects; e.g., between a page and a pop-up that it spawned, or between a page and an iframe embedded within it.

Cross-document messaging (aka postMessage) is an API introduced in the WHATWG HTML5 draft specification, allowing documents to communicate with one another across different origins, or source domains. Prior to HTML5, Web browsers disallowed cross-site scripting, to protect against security attacks.

See MDN Window.postMessage() API Reference

Related APIs

863 questions
0
votes
2 answers

How can I have 2 instances of dll function yet still use both of them?

[DllImport("user32.dll")] public static extern int FindWindow(string lpClassName, string lpWindowName); [DllImport("user32.dll")] public static extern IntPtr FindWindow(string lpClassName, string lpWindowName); Like this. I need…
a23ch
  • 1
  • 1
0
votes
2 answers

What does WindProc do for me?

I have a multiple dialog MFC client app that i am working on. This client can receive a lot of messaging (>10Hz) to the main dialog, which often performs some small function, then forwards that message onto the another dialog for processing. In my…
Jason
  • 2,147
  • 6
  • 32
  • 40
0
votes
0 answers

C# PostMessage CTRL + V

I am trying to send the paste function on another form. I give that window focus and then send this message... PostMessage(WoWVar.WindowHandle, (uint)WM_KEYDOWN, ((IntPtr)VK_CONTROL), (IntPtr)0x1); PostMessage(WoWVar.WindowHandle,…
user1127093
  • 85
  • 1
  • 3
  • 8
0
votes
1 answer

Accessing and modifying iframe contents, postMessage vs jQuery.contents()

It's possible with $('#iframe_id').contents().find('.stuff_to_modify).addClass('whatever'); But it's also possible using window.postMessage events, by sending a do_something message to a script from the iframe, which does the modifications when the…
Alex
  • 66,732
  • 177
  • 439
  • 641
0
votes
2 answers

HTML 5 postMessage (same domain)

I am trying to get the HTML postMessage function working? I have a found a few sites giving the example but for some reason a struggling. The code for the 2 pages is shown below, any help would be apprecaited. Thanks and…
Smudger
  • 10,451
  • 29
  • 104
  • 179
0
votes
1 answer

Does IE8 have any specific restrictions on postMessage to IFrames?

I have a web application with an iframe that needs to communicate with its hosting page. The iframe and the host are on different domains and protocols (the iframe is https, the main page http). I use postMessage to get a small bit of state (user…
Patrick Thill
  • 225
  • 2
  • 10
0
votes
1 answer

Open/Change IE9 Tabs Using SendMessage/PostMessage

I'm trying basically SendKey's to IE9 to change tabs. I have 3 tabs so I'd need to Send keys Ctrl+1, Ctrl+2, Ctrl+3 and also Ctrl+T to open a new tab. I start by adding the import dlls and constants [DllImport("user32.dll")] public static extern…
Andre Walker
  • 79
  • 1
  • 1
  • 11
0
votes
2 answers

C# what is the necessary library for PostMessage?

I am trying to simulate a keypress in C# and I'm getting these errors: Error 2 The name 'WM_KEYDOWN' does not exist in the current context c:\users\frk\documents\visual studio 2010\Projects\HaxBot3\HaxBot3\Form1.cs 28 52 HaxBot3 Error 5 …
void
  • 1,876
  • 8
  • 24
  • 30
-1
votes
0 answers

Parent to Child Communication using postMessage() not Working- Cross Domain

Tried to load an angular web app inside an ionic app using iframe, Main concern is, I need to use the locally stored values from ionic app to angular web app when entered through iframe instead of using query params which sometimes gave error as…
-1
votes
1 answer

Stop WndProc processing during shutdown of the app

I have defined a WndProc which looks similar to below (the code is written in C++Builder, but it applies in similar form to Delphi as well): #define WM_SETTINGS_UPDATE WM_APP + 1234 #define WM_GUI_UPDATE WM_APP + 1235 void __fastcall…
Coder12345
  • 3,431
  • 3
  • 33
  • 73
-1
votes
1 answer

Does Web Worker postMessage benefit from string interning?

Worker.prototype.postMessage() can send JavaScript objects back to the UI thread. It employs a Structured clone algorithm, which is capable of (for example) preserving cyclical references. Does the structure produced by the structured clone…
Birchlabs
  • 7,437
  • 5
  • 35
  • 54
-1
votes
1 answer

Passing ImageData via postMessage doesnt work on chrome

EDIT: It ended up being very relevant information that this only happens when the ImageDate comes from WASM, I dont know why this would matter. If anyone knows anything about this behaviour and can explain why this happens with WASM-originated…
J. Aarts
  • 144
  • 2
  • 10
-1
votes
1 answer

dispatchmessage function didn't execute WM_TIMER message when PostMessage

i am learning win32 thesedays and playing with PostMessage function. tricky thing i found was when posting WM_TIMER message into window message queue, window didn't receive any message. if only receive when i set lparam to 0, otherwise not working…
KIM CHANGJUN
  • 99
  • 11
-1
votes
1 answer

Using PostMessage() or SendMessage() to send uppercase letters

I'm trying to send uppercase letters or symbols (!@# etc), using the PostMessage() function: [DllImport("user32.dll")] public static extern IntPtr PostMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam); I tried sending both shift and the…
user13661398
-1
votes
1 answer

How to automate UI keyboard input? pywin32 PostMessage vs Powershell SendKeys

Motivation: I'm using a software that doesn't have an API to interface with ... I have no alternative and have to open the software, send simple key sequence, then close ... Again and again, so I want to automate this process. Goal: Send…
techtana
  • 315
  • 2
  • 9