brave / muon

[DEPRECATED] Build browsers and browser like applications with HTML, CSS, and JavaScript
https://discord.gg/TcT5tX2
MIT License
971 stars 114 forks source link

Webview mutes parent.postMessage() #763

Closed sheinin closed 6 years ago

sheinin commented 6 years ago

Moving an application to Muon from Electron.

The app contained "iframe" with page that called parent.postMessage() to send JSON data to renderer process. After changing "iframe" to "webview" the function stopped working. The page that sends the message is not Node.

documentation mentions:

// In guest page. const {ipcRenderer} = require('electron') ipcRenderer.on('ping', () => { ipcRenderer.sendToHost('pong') })

But there is no node in guest page? I suppose the above is from Electron docs that were not adapted yet.

What workaround may you suggest?

sheinin commented 6 years ago

Workaround described here worked: https://stackoverflow.com/questions/30367455/how-to-communicate-with-webview-in-chrome-app