Skip to content
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

default value for javaScriptEnabled is false #14834

Closed
wants to merge 1 commit into from
Closed

default value for javaScriptEnabled is false #14834

wants to merge 1 commit into from

Conversation

koenpunt
Copy link
Contributor

@koenpunt koenpunt commented Jul 5, 2017

This did cost me quite some time, but it turns out the default value for javaScriptEnabled isn't true, but false. So without it, any JavaScript injected through injectJavaScript/injectedJavaScript won't ever make it to the webview.

Ref: https://developer.android.com/reference/android/webkit/WebSettings.html#setJavaScriptEnabled(boolean)

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. GH Review: review-needed labels Jul 5, 2017
@charpeni
Copy link
Contributor

charpeni commented Jul 5, 2017

I guess that the default value was referring to defaultProps, not Android one.

static defaultProps = {
  javaScriptEnabled : true,
  scalesPageToFit: true,
};

https://github.com/koenpunt/react-native/blob/master/Libraries/Components/WebView/WebView.android.js#L188

@koenpunt
Copy link
Contributor Author

koenpunt commented Jul 5, 2017

@charpeni probably, but the default prop apparently isn't passed to the native view?

@koenpunt
Copy link
Contributor Author

koenpunt commented Jul 5, 2017

So my change might not be applicable, but there's an issue with it nonetheless.

@facebook-github-bot
Copy link
Contributor

@koenpunt 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.

@stale
Copy link

stale bot commented Nov 16, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Nov 16, 2017
@stale stale bot closed this Nov 23, 2017
@koenpunt koenpunt deleted the patch-4 branch June 3, 2021 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants