-
Notifications
You must be signed in to change notification settings - Fork 24.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WebView] [BUGFIX] onMessage should not break postMessage #18546
Conversation
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed. If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
Generated by 🚫 dangerJS |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
Would it be possible to backport this bugfix to some older releases? I'm interested in 0.53. Not sure what's react-native policy for such changes. PS. |
@chrmod I tried to find reviewers for this pull request and wanted to ping them to take another look. However, based on the blame information for the files in this pull request I couldn't find any reviewers. This sometimes happens when the files in the pull request are new or don't exist on master anymore. Is this pull request still relevant? If yes could you please rebase? In case you know who has context on this code feel free to mention them in a comment (one person is fine). Thanks for reading and hope you will continue contributing to the project. |
ba02b9b
to
b853cf7
Compare
@chrmod I tried to find reviewers for this pull request and wanted to ping them to take another look. However, based on the blame information for the files in this pull request I couldn't find any reviewers. This sometimes happens when the files in the pull request are new or don't exist on master anymore. Is this pull request still relevant? If yes could you please rebase? In case you know who has context on this code feel free to mention them in a comment (one person is fine). Thanks for reading and hope you will continue contributing to the project. |
@shergin Could you please review and merge this PR? It has only two lines of code changed. |
WebView PRs are on hold pending approval of the WebView proposal at react-native-community/discussions-and-proposals#3 |
@chrmod, I don't think we support back-porting to earlier version of React Native. 😔 Also, this change is reasonable. I'd love to review and merge this, but can't because we're trying to pull out WebViews into react-native-community/react-native-webview. Since WebViews are eventually going to be deleted from this repository, would you mind re-launching this PR there instead? Before we exported WebViews, we also launched the new |
I've written this issue: react-native-webview/react-native-webview#66 for this as a roundup of issues related to 2 way communication between RN<->WebView. Please discuss there. |
onMessage
handler, replaces originalwindow.postMessage
function, so messages being sent by the applications never arrive to their target destinations. Some application liketwitter.com
are simply broken in such environments.This PR, changes the implementation of replaced
window.postMessage
to call the original function in order to prevent website breakage.Those issues are probably caused by described problem:
There are probably more reports like that.
I've tested changes on Android and I'm assuming the iOS version should work as well.
Test Plan
Create a WebView component with
onMessage
handler andurl
set tohttps://twitter.com/
. Log in to twitter.With changes of this PR, twitter feed will load correctly. Without changes, no tweets will be loaded.
Release Notes
[WebView] [BUGFIX] - onMessage should not break postMessage