react-native-web-community / react-native-web-webview

React Native for Web implementation of RN's WebView
https://react-native-web-community.github.io/react-native-web-webview/storybook
MIT License
133 stars 48 forks source link

Window variable for web webview #79

Closed manan057 closed 10 months ago

manan057 commented 10 months ago

Hi,

For React Native window.ReactNativeWebView will always exist but window.webpackHotUpdate_my_app_electron or window.REACT_NAVIGATION_DEVTOOLS will be undefined initially for a couple of seconds until electron loads up the renderer.

Is there a way to detect if the app is running in web webview using the window variables?

manan057 commented 10 months ago

Figured it out. Turns out in react native you can access window variables with window.blah but for web webview we must use window.parent.blah