Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

phonegap InappBrowser not working with viewport

Tags:

cordova

I'm using PhoneGap 2.3 and now when I open a new URL with 'window.open', my URL opens in the inAppBrowser.

In this browser, my viewport metatag is not working but when I put my URL in a safari browser the viewport is working fine.

In PhoneGap, I have set to 'yes' for 'enableViewportScale' but it doesn't work.

Somebody have a solution?

Thanks

like image 223
user1872994 Avatar asked Feb 13 '13 13:02

user1872994


2 Answers

enableViewportScale was added in 2.4.0 so you should just need to upgrade.

http://docs.phonegap.com/en/2.4.0/cordova_inappbrowser_inappbrowser.md.html#InAppBrowser

(under window.open)

EDIT:

Also, the way to call the options is one singular string, not an object:

So it should look like this:

'location=no,enableViewportScale=yes'
like image 148
Kevin Kulla Avatar answered Nov 15 '22 09:11

Kevin Kulla


Kevin is right

window.open('http://apache.org', '_blank', 'location=no,EnableViewPortScale=yes');

(ok on iOS only)

like image 37
Alan124 Avatar answered Nov 15 '22 07:11

Alan124