iFrame element not part of the ad

139 views
Skip to first unread message

Uroš Kovač

unread,
Nov 6, 2016, 5:32:12 PM11/6/16
to Google Mobile Ads SDK Developers
Hi,

using the bellow snippet I was able to reproduce a behaviour that appears to be a bug. The iFrame element should appear inline (as part of the ad) but it appears in a browser window. The issue occurs on iOS9 and iOS10 devices using latest versions of DFP and ADMOB test apps using MRAID SDK.  

Here is the code snippet: 
<script src="mraid.js"></script>
<button id='btn' style="width: 200px; height: 50px; font-size: 20px;">Add iFrame</div>
<script>
var btn = document.querySelector('#btn');
btn.addEventListener('click', function() {
    var iFrame = document.createElement('iframe');
    iFrame.src = 'http://www.rtvslo.si';
    document.body.appendChild(iFrame);
});
</script>

Please ping me if you need additional information,
Uros

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Nov 7, 2016, 12:30:21 PM11/7/16
to Google Mobile Ads SDK Developers
Hi Uroš,

Thank you for bringing this to our attention. I will be sharing this with the team and will keep you posted on any updates with regards to this.

Thanks,
Arjun Busani
Mobile Ads SDK Team

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Nov 7, 2016, 3:05:03 PM11/7/16
to Google Mobile Ads SDK Developers
Hi Uroš,

So the team just got back to me and they have recommended to load up all of your resources in onLoad() itself and hide your iFrame. Then when the user clicks on your AdView, simply unhide your iFrame to show instead of adding it on to a div right there. Let us know if you need anything else.

Thanks,
Arjun Busani
Mobile Ads SDK Team

Darko Bozidar

unread,
Nov 30, 2016, 11:13:44 AM11/30/16
to Google Mobile Ads SDK Developers
Hi Arjun,

the issue issue occurs in case if user taps on the page before it was loaded.

We observed the following 2 things:

1. If the iFrame element is inserted into DOM without any prior user interaction, the iframe element is rendered as part of the ad - see example #1:

Another issue here is that URL provided in the iFrame src attribute is not rendered in the iFrame - the iFrame is blank.
 
2. If the iFrame element is inserted into DOM after a non related user interaction (such as pressing on a blank part of the ad), the iFrame element is rendered in a separate webview - see example #2:
 
The code sample used is the same in both cases above (and also in the Android case bellow) - the iFrame element is inserted into DOM after 8 seconds:

<script src="mraid.js"></script>

<p>Waiting for 5s</p>

<script>
setTimeout
(function() {

    
var iFrame = document.createElement('iframe');
    iFrame
.src = 'http://www.rtvslo.si';
    document
.body.appendChild(iFrame);
}, 8000);
</script>


Ideally, we would expect that the behaviour would be the same as it is in browsers, where after a time limit of 200ms, the click event is no longer associated with the actions that might follow - in our case, a user taps on an empty ad and few seconds later, the iFrame element insertion is still considered as part of that tap. But the tap actually occurred way before (up to 8 seconds ago) the iFrame element was added to DOM.
 
We have also noticed that the behaviour on Android devices is different than on iOS devices. If you run the above code on Android devices using DFP interstitial app, the iFrame renders inside of the ad even in case of a user interaction:
This would mean inconsistent behaviour when comparing Android and iOS platforms.

Also we noticed the issue as described above in case #1 - URL provided in the iFrame src attribute is not rendered in the iFrame - the iFrame is blank.

Thanks,
Darko

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Nov 30, 2016, 11:58:40 AM11/30/16
to Google Mobile Ads SDK Developers
Hi Darko,

I would be emailing you directly about this.

Thanks,
Arjun Busani
Mobile Ads SDK Team

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Jan 17, 2017, 10:57:34 AM1/17/17
to Google Mobile Ads SDK Developers
Hi Žiga,

I still do not have any update on this but will keep you posted on any new information that I can share.

Thanks,
Arjun Busani
Mobile Ads SDK Team
Reply all
Reply to author
Forward
0 new messages