WebView onMessage listener conflict with window.postMessage to iFrame #19866
Labels
Component: WebView
Related to the WebView component.
Resolution: Locked
This issue was locked by the bot.
Environment
Environment:
OS: macOS Sierra 10.12.6
Node: 8.11.3
Yarn: 1.7.0
npm: 5.6.0
Watchman: 4.9.0
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: 3.1 AI-173.4670197
Packages: (wanted => installed)
react: 16.3.2 => 16.3.2
react-native: 0.55.4 => 0.55.4
Description
This issue affects both iOS and Android.
The issue relates to how using onMessage on WebView appears to affect post messages from the actual web app which wants to send out messages to an iFrame.
It appears the listeners which is being picked up by react native app isn't being picked up within the web page itself - as if the onMessage is conflicting with natural behaviour within the web page.
Example wise, any simple WebView with onMessage prop and handler defined.
A web page which has its own postMessage e.g.
where origin is simply the origin of the url.
Is there reason for this potential conflict and why react native is not respecting the origin? Disabling onMessage on the web view works for the iFrame perfectly.
Reproducible Demo
This demo shows two WebViews (content from playbuzz.com) with the exact same configuration. But one has onMessage set.
https://snack.expo.io/HyG0CXAZm
The text was updated successfully, but these errors were encountered: