cordova-plugin-ionic-webview icon indicating copy to clipboard operation
cordova-plugin-ionic-webview copied to clipboard

Enabling allowsBackForwardNavigationGestures on WKWebView

Open pschinis opened this issue 4 years ago • 4 comments

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?

pschinis avatar May 25 '20 18:05 pschinis

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

jcesarmobile avatar May 26 '20 10:05 jcesarmobile

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

pschinis avatar May 26 '20 15:05 pschinis

@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.

xinhaoxx avatar Sep 01 '20 03:09 xinhaoxx

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

samuelbeaulieu avatar Sep 23 '20 14:09 samuelbeaulieu