postmessage

How to properly use postMessage to do cross-domain messaging with html5 and modern browsers ? I still get errors

雨燕双飞 提交于 2019-12-01 06:48:58
I'm sure something is wrong here but I can't quite put a finger on it... The example here behaves just fine with no notices or errors on the console, so it means my browser supports cross domain messaging with html5 (of course it does, it's Chrome 14..). My code does more or less the following: A script loaded in WebsiteA.com created an iframe and appends it to WebsiteA.com's document. The frame appended will contain WebsiteB.com and when it's loaded, it must send a message to it's parent, WebsiteA.com, to tell it that WebsiteB.com is ready to receive some JSON. When WebsiteA.com get's this

postMessage between cross-domain windows not working in IE10 (it works for frames)

二次信任 提交于 2019-12-01 05:47:13
I followed this tutorial http://davidwalsh.name/window-postmessage , and created cross domain messaging scripts which works in Chrome and Firefox but not in IE 10. Could anyone give me some hits on how to modify it for IE 8+? At one server(eg: 192.168.15.223)--receiver <script> //listener window.addEventListener('message',function(event) { if(event.origin !== 'http://120.0.0.211') return; document.getElementById('cc').innerHTML = event.data; },false); window.attachEvent('onmessage',function(event) { if(event.origin !== 'http://120.0.0.211') return; document.getElementById('cc').innerHTML =

How to properly use postMessage to do cross-domain messaging with html5 and modern browsers ? I still get errors

筅森魡賤 提交于 2019-12-01 05:32:42
问题 I'm sure something is wrong here but I can't quite put a finger on it... The example here behaves just fine with no notices or errors on the console, so it means my browser supports cross domain messaging with html5 (of course it does, it's Chrome 14..). My code does more or less the following: A script loaded in WebsiteA.com created an iframe and appends it to WebsiteA.com's document. The frame appended will contain WebsiteB.com and when it's loaded, it must send a message to it's parent,

VB.NET Send Tab key to another application window

佐手、 提交于 2019-11-30 21:17:38
问题 I want to send "{TAB}" Key to another application window (send the key to the window not to textbox). I tried: SendMessage(hWnd, WM_SETHOTKEY, VK_TAB, 0) Nothing happened. my goal is: send tab key to my application Or other application when the application window is not in focus. ( i know that sendkey is not professional in this case there is no choice (This is the first time that I'm using it).) I made many attempts and I always returned to the same result: Nothing happened. Does anyone know

window.postmessage() to communicate between applications in different tabs

╄→гoц情女王★ 提交于 2019-11-30 16:36:35
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 about different tabs? Update: Case scenario: user plays audio from vk.com in one tab user starts playing video from youtube.com in another tab youtube.com sends postmessage() to vk.com that video started playing vk.com makes audio silent Thanks cloudfeet It can be done if you use an "intermediate page" loaded in an iFrame. The (theoretical) solution uses two separate methods of inter-page

Benefit of CORS over cross-domain messaging

梦想的初衷 提交于 2019-11-30 14:39:41
CORS and cross-domain messaging look the same to me: they allow communication across domains. Are there any reasons to use one vs. the other? CORS is for ajax requests or flash requests that flash wouldn't normally allow. For example, if there is no cross-domain policy for domain x, and you retrieve an mp3 file from there via flash for playback, flash will not allow you to read the id3 tags of the mp3 file. For ajax, you flat out cannot make the request if the target server doesn't have a cross-domain policy that allows your domain to make requests. Cross-domain messaging allows you to

I can't understand how to use SendMessage or PostMessage calls

一曲冷凌霜 提交于 2019-11-30 13:03:20
问题 I need to simulate a keypress in a third party application. Let's say I have a C# application that needs to send an "8" to the Calculator application. I can't use the SendKeys of .Net or the keybd_event of win32 api because they both require the window to be the top active one, which is not case in my situation. So that leaves me with the calls sendMessage and postMessage. I've been trying in the last three hours trying to get some results but right now I'm completely hopeless. I have the

Any good debugger for HTML5 Javascript postMessage API? [closed]

我怕爱的太早我们不能终老 提交于 2019-11-30 10:58:40
Is there any good tool out there that allows developers to correctly debug messages sent between windows with postMessage ? Or maybe a plugin for Firebug? Firebug (as of 1.11 beta 1) supports this with monitorEvents() . You can do something like this: $("iframe").each(function(i, e) { console.log("Monitoring messages sent to: iframe(" + i + ")#" + $(this).attr("id")); monitorEvents(this.contentWindow, "message"); // Send a test message to this iframe this.contentWindow.postMessage("Hi iframe - " + i, "*"); }); console.log("Monitoring messages sent to window"); monitorEvents(window, "message");

Detect whether postMessage can send objects?

南楼画角 提交于 2019-11-30 05:20:01
I'm looking for a neat way to detect whether postMessage in the browser supports the sending and receiving of objects or just strings. I figure that someone out there must have wrote something that does this but I have not managed to find a solution. I'm using postMessage to send data to/from a WebWorker. Whilst detecting whether the browser supports workers is straight-forward, detecting whether objects can be send via postMessage has proved more difficult. I'd like to write a simple detection function. So, if the browser supports the sending of objects to use that. If only strings are

I can't understand how to use SendMessage or PostMessage calls

元气小坏坏 提交于 2019-11-30 05:19:49
I need to simulate a keypress in a third party application. Let's say I have a C# application that needs to send an "8" to the Calculator application. I can't use the SendKeys of .Net or the keybd_event of win32 api because they both require the window to be the top active one, which is not case in my situation. So that leaves me with the calls sendMessage and postMessage. I've been trying in the last three hours trying to get some results but right now I'm completely hopeless. I have the following: [DllImport("user32.dll")] public static extern int FindWindow(string lpClassName,string