forked from react-native-webview/react-native-webview
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ios): Generate history API events on iOS (react-native-webview#1082
) BREAKING CHANGE: if you use onNavigationStateChange on iOS it will now trigger on # changes to the url. * Hook the `window.history` API on iOS to generate events The underlying WKWebView doesn't seem to generate any events in response to the `window.history` API - none of the `WKNavigationDelegate` methods fire. Given this limitation, the only way to know when the location changes via this API is to inject Javascript into the page and have it notify the native code directly when any of these functions are called. The `setTimeout` call gives up the current tick, allowing the location to change before firing the event. * Remove the outdated section about hash changes Now that this bug is fixed, the workaround is no longer required.
- Loading branch information
Showing
2 changed files
with
38 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters