ionic-team / cordova-plugin-ionic-webview

Web View plugin for Cordova, specialized for Ionic apps.
Apache License 2.0
484 stars 390 forks source link

Enabling allowsBackForwardNavigationGestures on WKWebView #574

Open pschinis opened 4 years ago

pschinis commented 4 years ago

Newer iPhones don't have a back button and users are used to being able to navigate back with a left-to-right swipe. WKWebView disables this behavior by default but it can be enabled with the allowsBackForwardNavigationGestures property of the WKWebView. I'm wondering if there's a way to set this property with this plugin or if not are there any plans to support this at some point?

jcesarmobile commented 4 years ago

it's not documented, but you can use <preference name="AllowBackForwardNavigationGestures" value="true" />

pschinis commented 4 years ago

That's awesome, thanks. Probably worth adding to the docs

xinhaoxx commented 3 years ago

@jcesarmobile Is it possible to set this preference dynamically from JavaScript?

just like cordova-plugin-wkwebview-engine, it can be set like this:

window.WkWebView.allowsBackForwardNavigationGestures(true) // or false

I want to prevent or allow AllowsBackForwardNavigationGestures for some pages in my project, but i can't find any way to set this preference 😅.

so i think if there is any way to set this preference from Javascript, That'll be awesome.

samuelbeaulieu commented 3 years ago

This pull request will allow it when the team merge it!