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

790 questions
0
votes
1 answer

Cross Document Messaging - post objects feature check FF3.6

I am talking between a window and an inserted iFrame, using cross domain messaging. The code below is the iframe talking back to the parent window. sendToParent = function (event, response) { // send to parent …
Will Hancock
  • 1,210
  • 4
  • 16
  • 27
0
votes
0 answers

Creating lparam for postmessage

I am having trouble with creating lparam for postmessage. I know that application gets such key: WM_KEYDOWN nVirtKey: VK_CONTROL cRepeat:1 ScanCode: 1D fExtended:0 fAltDown:0 fRepeat:0 fUp:0 WM_KEYDOWN nVirtKey: VK_LEFT cRepeat:1 ScanCode: 4B…
Immons
  • 237
  • 1
  • 10
0
votes
1 answer

Any way to read elements from another website in an iframe?

I'm playing around with some stuff and trying to discern if when using a cross-domain iframe(post_message) if I can read the elements: div-tag p-tag etc of site within the iframe? I haven't seen any other posts on this, so hopefully someone can…
Psyllex
  • 711
  • 2
  • 16
  • 29
0
votes
0 answers

How can I use authorize when accessed via window.postmessage in Javascript?

It seems window.postmessage that don't support authorization using username and password. (See) How can I authorize in postmessage like XMLHTTPRequest().open() meethod.(See) Thanks.
kinakomochi
  • 445
  • 3
  • 8
  • 14
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
  • 1,882
  • 6
  • 26
  • 37
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
  • 65
  • 1
  • 2
  • 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
  • 60,472
  • 154
  • 401
  • 592
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
  • 9,353
  • 27
  • 97
  • 178
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
  • 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,736
  • 6
  • 22
  • 28
-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
  • 5,931
  • 4
  • 28
  • 41
-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
  • 105
  • 2
  • 9
-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
  • 107
  • 9