Skip to content

Commit

Permalink
GLU-657/remove resize from securecreatives (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
florevallatmrf authored Aug 9, 2018
1 parent 5e6d9db commit 407d9de
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions src/secureCreatives.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import events from './events';
import { fireNativeTrackers } from './native';
import { EVENTS } from './constants';
import { isSlotMatchingAdUnitCode } from './utils';
import { auctionManager } from './auctionManager';
import find from 'core-js/library/fn/array/find';

Expand Down Expand Up @@ -56,7 +55,6 @@ function sendAdToCreative(adObject, remoteDomain, source) {
const { adId, ad, adUrl, width, height } = adObject;

if (adId) {
resizeRemoteCreative(adObject);
source.postMessage(JSON.stringify({
message: 'Prebid Response',
ad,
Expand All @@ -67,12 +65,3 @@ function sendAdToCreative(adObject, remoteDomain, source) {
}), remoteDomain);
}
}

function resizeRemoteCreative({ adUnitCode, width, height }) {
const iframe = document.getElementById(
find(window.googletag.pubads().getSlots().filter(isSlotMatchingAdUnitCode(adUnitCode)), slot => slot)
.getSlotElementId()).querySelector('iframe');

iframe.width = '' + width;
iframe.height = '' + height;
}

0 comments on commit 407d9de

Please sign in to comment.