fluttercommunity / flutter_webview_plugin

Community WebView Plugin - Allows Flutter to communicate with a native WebView.
https://pub.dev/packages/flutter_webview_plugin
Other
1.48k stars 931 forks source link

Callback to decide if a certain URL should be loaded #14

Open stefan-scholl opened 7 years ago

stefan-scholl commented 7 years ago

iOS has webView:shouldStartLoadWithRequest:navigationType: which can be used to deny loading if you don't want to follow a URL.

One of the possible uses: This could be used to communicate some state from within the webview. You parse the request and deny loading so the current page stays the same.

lejard-h commented 6 years ago

In the next release 0.0.10 we will be able to listen for state changed, but we won't be able to block url except by scheme http, https, about (only on iOS)

Since communication with dart side and native side are asynchrone, we won't be able to execute a function on dart side.

Maybe we can use a regexp to match url we want, any idea ?