AtanuCSE AtanuCSE - 1 month ago 20
Android Question

Hide history buttons in inAppBrowser Plugin Cordova 3 +

I'm using android, cordova 3.4.1+ and latest inAppBrowser plugin. I need the toolbar with

Done
button and without
history buttons
and
url location


So with this follwing line I've successfully removed the url position. But the history buttons are still showing.

window.open('http://example.com/some.jpg','_blank','location=no,toolbar=yes,EnableViewPortScale=yes');


Oh! And I also needed some tweaking in the
.java
file to make the toolbar visible while
location=no


But I can't find anyway to hide the history buttons. Can anyone please tell me how to hide the history buttons? Is it possible to do that by tweaking plugin's
.java
file? If not possible, is it possible to control the behaviour of the buttons from javascript? For example I want to set 'where to go next' for those history buttons........

Answer

I didn't found any way to control those history buttons behaviour yet.Like pressing forward will take to a new pre-defined address. I don't think that exists now. To hide those buttons , Go to

platforms\android\src\org\apache\cordova\inappbrowser\inAppBrowser.java

Find these lines

// Add the back and forward buttons to our action button container layout
actionButtonContainer.addView(back);
actionButtonContainer.addView(forward);

Comment them out.

Comments