Skip to content

Commit 54cc2ec

Browse files
committed
MOBILE-1462 iframe: Don't open in InAppBrowser if already prevented
1 parent b9e3d99 commit 54cc2ec

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

www/core/directives/iframe.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,11 @@ angular.module('mm.core')
127127
} else if (el.target == '_parent' || el.target == '_top' || el.target == '_blank') {
128128
// Opening links with _parent, _top or _blank can break the app. We'll open it in InAppBrowser.
129129
angular.element(el).on('click', function(e) {
130-
e.preventDefault();
131-
$mmUtil.openInApp(href);
130+
// If the link's already prevented then we won't open it in InAppBrowser.
131+
if (!e.defaultPrevented) {
132+
e.preventDefault();
133+
$mmUtil.openInApp(href);
134+
}
132135
});
133136
}
134137
}

0 commit comments

Comments
 (0)