I've build an Android app using CapacitorJS and I want to disable the native webview's swipe navigation (swipe from edges to go forward/back). Is that possible?
Can this be done through Javascript or an HTML meta tag? As far as I can tell this is not possible.
Is there a Capacitor plugin or setting to do this? (Ionic, which uses Capacitor, has the swipeBackEnabled setting that sounds like it does what I'm looking for)
If not, can it be set on the Android WebView directly?
Related
I am trying to do SSO using Chrome Tabs in my Android Application.
Whenever the chrome comes in it also has options menu of chrome - Is there a way to disable this options menu.
Attached is a screenshot
No, currently is not possibile: you can add items but not remove the button.
https://developer.chrome.com/multidevice/android/customtabs
Simply use a WebView instead of CustomTabs - then there is nothing to hide away, to begin with.
In cases like this you should use phonegap instead of use chrome browser as webview read the docs
basically it runs chrome webview on android, and safari webview on IOS but without all chrome/safari options.
Hey there so in my opinion you should use simple Android webview if you don't want your user to access these options.
Just create a new activity/fragment that contains webview and open your website or any url within it.
This might help you from android developer docs.
Also try this example that might be useful.
I have converted a jquery mobile webpage to android app using phonegap.
The problem is that mavbar/menu in Android is cutting the menu words. i.e. What we do -> What we... .Can u suggest me a better way to create a menu without damaging the UI?
Using Bootstrap CSS is the better way to make your application work well on all screen resolution
I am confused about how to architecture my phonegap application.
Do I use a single-page application wherein I load relevant views using ajax ?
Or should I use many local html files and keep navigating between them using href tags ? Also, window.location seems to load the second page in a browser window, which is undesirable. I want to have whole of my app running in the same webview.
How can I stay on the same webview, while navigating between the pages using javascript ?
Try using a javascript framework like backbone or sencha touch. Jquery-mobile will work but everything will be encapsulated on one page
In a WebView on the Android platform, is it possible to listen to when a div that is marked with contenteditable=true is edited?
If it is not possible, what would be my next best option?
Do you own the web page loaded in the WebView?
Javascript runs in the WebView can interact with the host Android app (see this guide), and it seems that the listening can be done in javascript (see this), so if you can modify the web page and add a callback to Android java code then it can be done.
I experimenting with WebView in Android and I can't figure out how to make it work like the native browser.
I have an example for this:
Go to deviantART.com in native browser. Press Menu button. At the bottom of the menu there will be a link to disable mobile view and it works as expected. This exact same thing doesn't work in WebView. It simply turns the menu off and that is all, mobil CSS still stays intact.
I need to make users disable deviantART's mobile CSS, so I need the WebView to work like this.
JavaScript and DOMStorage are enabled.
I need the proper code or an workaround, but after hours of searching I didn't find anything that connected to this problem.
Thank you in advance.
If all you want is to turn off the mobile view you can set the user-agent string on the WebView using setUserAgentString (String ua).