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

react-native-webview-bridge for react-native-windows #2

Open
rozele opened this issue Aug 16, 2017 · 3 comments
Open

react-native-webview-bridge for react-native-windows #2

rozele opened this issue Aug 16, 2017 · 3 comments
Assignees
Labels

Comments

@rozele
Copy link
Member

rozele commented Aug 16, 2017

No description provided.

@rozele
Copy link
Member Author

rozele commented Aug 17, 2017

After the initial investigation, I've found two options for communication from the WebView back to the native bridge, AddWebAllowedObject and window.external.notify.

There are limitations with both of these:

  1. WebView.AddWebAllowedObject works only works when navigated from NavigateToString or when navigating to a ms-appx-web: URI, and I have to introduce an additional WinRT component library in order to use it.
  2. window.external.notify only works when the URIs are whitelisted in the appxmanifest or from NavigateToString / ms-appx-web: URIs.

Currently, the most flexible is likely the ScriptNotify event and window.external.notify, with the caveat that the app needs to declare upfront what domains are supported (and it must use HTTPS).

@rozele
Copy link
Member Author

rozele commented Aug 17, 2017

I've reached out to the Web Platform team in Windows for further guidance on if we have any options for more general hooks in WebView.

@rozele
Copy link
Member Author

rozele commented Aug 29, 2017

Confirmed with Web Platforms team scenario to load JavaScript prior to page loading is not currently supported in UWP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant