Open chrmod opened 6 years ago
there are some react-native issues that may be related to this problem:
Have found react-native
PR that implemented webview messaging https://github.com/facebook/react-native/commit/abb8ea3aea686e2cd881a61fbc66d137857ef422 and it looks like the original window.postMessage
function gets replaced with react-native one, which means, the messages never arrive to their original destinations. I will try to fix that by calling original function along with react-native replacement.
OK. Have implemented react-native bugfix. This PR has to be merged before we can progress https://github.com/facebook/react-native/pull/18546
This little trick is likely to work as it is battle tested by
firefox-ios
project: https://github.com/mozilla-mobile/firefox-ios/blob/2d5ca06880b9288be74b7eb1a6cb7c937292387d/Client/Frontend/UserContent/UserScripts/MainFrame/AtDocumentStart/HistoryStateHelper.jsUnfortunately on Android (not sure about iOS), using
onMessage
on a web view breaks certain pages, like twitter.com, it is probably caused by a fact Android web view replaces nativepostMessage
https://github.com/facebook/react-native/blob/0.39-stable/React/Views/RCTWebView.m#L286