I'm writing a temperature logger via chrome.usb ANT+ wireless communication. I'm struggeling with sending messages from a window to the sandboxed iframe (with a local script) thats embedded in the window. The reason for sandboxing the in the iframe is that's impossible to run knockoutjs due to CSP.
var messageHandler = function(e) {
console.log('Knockout App got message', e.data);
window.addEventListener('message', messageHandler);
When I type "window.postMessage('test','*')" in the <top frame> in developer tools nothing happens. Changing the frame in the drop-down in devtools and typing the same command calls the messageHandler.
I tried to access the .contentWindow property of the iframe, but it gives "DOMException". And accessing .contentDocument gives SecurityError: Blocked a frame with origin "chrome-extension://kbjdachfmhmlnekmflcomjkhijhjkacl" from accessing a cross-origin frame'
Any thoughts?