Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable zoom buttons in Phonegap's inappbrowser

After hours of searching and trying different things I'm close to give up. I want to open an external URL in the inAppBrowser that is now included to the Phonegap Build. I remove the address bar with location=no (also tried toolbar=no, but it didn't do anything), however the zoom (+ and - buttons) that appears whenever you scroll the page won't go away. I can't find a way to disable it, but maybe I overlook something? I'd just use the pinch zoom, so I don't see the reason to have these ugly buttons on top of the page (which is designed specifically for this app).

So is there a way to disable built-in zoom buttons?

I'm testing on Android, but planning to also work on the iPhone version.

like image 542
Dmitriy Gamolin Avatar asked May 09 '14 13:05

Dmitriy Gamolin


People also ask

How do I use InAppBrowser in Cordova?

function openBrowser() { var url = 'https://cordova.apache.org'; var target = '_blank'; var options = "location = yes" var ref = cordova. InAppBrowser. open(url, target, options); ref. addEventListener('loadstart', loadstartCallback); ref.

What is Inapp browser?

The InAppBrowser is a web browser view that displays when calling [window. open](window. open. html)() , or when opening a link formed as <a target="_blank"> . var ref = window.

How do I close InAppBrowser?

There is no action to close the InAppBrowser. How can we achieve this? The user is redirected to an aws login page in the IAB and after suscessfull login the IAB should close and the user should be redirected to a screen in the app.


2 Answers

I had the same issue, but using Cordova instead of Phonegap Build. The trick that did it for me was to change line 575 of InAppBrowser.java to settings.setBuiltInZoomControls(false);.

That won't work for iOS of course, but as far as I know there is no other build in way provided by Phonegap/Cordova.

like image 86
user3677008 Avatar answered Sep 19 '22 07:09

user3677008


try zoom=no

you can find details on cordova inappbrowser plugin documentation: https://github.com/apache/cordova-plugin-inappbrowser

like image 36
Görkem Öğüt Avatar answered Sep 22 '22 07:09

Görkem Öğüt