-
Notifications
You must be signed in to change notification settings - Fork 48
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
injectedJavascript not working #35
Comments
Same issue here... |
@jo-fra I think I found the bug.. In https://github.com/react-native-web-community/react-native-web-webview/blob/master/src/index.js#L20 the function returns without updating the injected javascript if source has no method. So in your minimal sample app add <WebView
originWhitelist={['*']}
source={{ html: '<h1>This is a static HTML source!</h1>', method: 'get' }}
injectedJavaScript={runFirst}
/> |
I'm having the same issue - tried the approach mentioned but didnt work for me... |
@bwoodlt I think method: 'get' only works if you use the uri instead of the html. If you already have the html string, I think you can just append it to the end like so.
|
i just followed the initial post instructions [ thank you !!!! 😺 ] and the javascript only runs in android _ it does not run in ios or web :
|
Also having the same problem |
Hi,
I try to run a minimal example with injectedJavaScript prop. However the javascript code seems to be not executed.
Versions used:
"expo": "~38.0.8",
"react-native": "https://github.com/expo/react-native/archive/sdk-38.0.2.tar.gz",
"react-native-web": "^0.13.8",
"react-native-web-webview": "^1.0.2",
"react-native-webview": "^10.7.0"
Setup steps:
expo init
yarn add react-native-webview
yarn add react-native-web-webview
expo customize:web
This is the minimal sample app:
The HTML gets rendered but javascript not executed.
Also is the injectJavascript method method supported or is it planned?
The text was updated successfully, but these errors were encountered: