Skip to content

Commit 4e98321

Browse files
committed
Merge pull request #435 from dpalou/MOBILE-1498
MOBILE-1498 inappbrowser: Hide location and allow zoom in iOS
2 parents 56d5cc1 + 3e020e2 commit 4e98321

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

www/core/lib/util.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,17 @@ angular.module('mm.core')
391391
* @return {Void}
392392
*/
393393
self.openInApp = function(url) {
394-
window.open(url, '_blank');
394+
if (!url) {
395+
return;
396+
}
397+
398+
var options = 'enableViewPortScale=yes'; // Enable zoom on iOS.
399+
if (ionic.Platform.isIOS() && url.indexOf('file://') === 0) {
400+
// The URL uses file protocol, don't show it on iOS.
401+
// In Android we keep it because otherwise we lose the whole toolbar.
402+
options += ',location=no';
403+
}
404+
window.open(url, '_blank', options);
395405
};
396406

397407
/**

0 commit comments

Comments
 (0)