我写了一个内容脚本,将iframe注入任何网站(因此不同的域).
我需要父网站向子iframe发送一些信息,但我找不到办法.
代码
var targetFrame = $('#myIframe')[0];
targetFrame.contentWindow.postMessage('the message', '*');
Run Code Online (Sandbox Code Playgroud)
以某种方式不起作用,我得到一个Cannot call method 'postMessage' of undefined错误.但是当我在Chrome的控制台中直接尝试相同的代码时,它确实有用.
我将postMessage从子节点发送到父节点没有问题,但只需要一种方法让父节点向子节点iframe发送消息.
AVAudioRecorder 允许录制外部音频。但是,我希望录制我的应用程序制作的音频(通过众多 AVAudioPlayers),这在 iPhone 上可行吗?
cocoa-touch ×1
core-audio ×1
html5 ×1
ios ×1
iphone ×1
javascript ×1
objective-c ×1
postmessage ×1