[
https://issues.apache.org/jira/browse/CB-2822?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13616225#comment-13616225
]
Ralph Paßgang commented on CB-2822:
-----------------------------------
I found the problem in our project...
As reported, we use the InAppBrowser for displaying the target sites for ads.
The ads we get from the adserver look like this (simplified):
<a href="http://www.google.de/"><img src="http://www.customer.de/ad.jpg"></a>
In our app we rewrite this to the following:
<a onclick="return false;" href="http://www.google.de/"><img
src="http://www.customer.de/ad.jpg"></a>
And we add a eventListener for the tap event on the parent container, which
opens the advertisement (and does tracking and stuff like this).
On iOS 6, Android and other platforms this seems to work. The "return false;"
in the onclick handler does the same as preventDefault(). On iOS 5 this doesn't
work. So we open the ad via our own event listener in the InAppBrowser, and the
link in the a href opens the page in "_self".
Sorry for thinking the issue is coming from cordova. Thanks for your help!
> InAppBrowser on iOS 5.x opens page in "_blank" and "_self" at the same time.
> "_blank" was expected.
> ---------------------------------------------------------------------------------------------------
>
> Key: CB-2822
> URL: https://issues.apache.org/jira/browse/CB-2822
> Project: Apache Cordova
> Issue Type: Bug
> Components: iOS
> Affects Versions: 2.5.0
> Environment: iOS 5.x
> Reporter: Ralph Paßgang
> Assignee: Shazron Abdullah
> Priority: Critical
> Fix For: 2.6.0
>
> Attachments: IMG_1223.png, IMG_1224.png, IMG_1225.png
>
>
> If we open a webpage within our app with the following command:
> window.open(<url>, '_blank');
> then it works on iOS 6.x, Android and BlackBerry, but on iOS 5.x the
> following happens:
> The InAppBrowser is opened and <url> gets loaded and displayed. After closing
> the InAppBrowser you will see that the app itself got replaced with the same
> page that has been loaded in the InAppBrowser before (the page for <url>).
> This is what I would expect if the page would have been loaded with "_self",
> but because "_blank" was used, this is totally unwanted.
> That leads to the fact that the app is not useable anymore after using the
> InAppBrowser and must be closed, terminated & restarted completely to be
> functional again.
> I will attach some screenshots to visualize the problem.
> best regards,
> Ralph
> P.s.: I want to use this opportunity to thank you and all contributors for
> such a great project. Keep up the great work!
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira