From 24305dbb9bccaf17fe1dc4be037c3c0407d7b7f2 Mon Sep 17 00:00:00 2001 From: Flore Vallat Date: Mon, 6 Aug 2018 16:52:36 +0200 Subject: [PATCH 1/2] remove resizing --- src/secureCreatives.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/secureCreatives.js b/src/secureCreatives.js index 424d1402831..68714758f29 100644 --- a/src/secureCreatives.js +++ b/src/secureCreatives.js @@ -56,7 +56,7 @@ function sendAdToCreative(adObject, remoteDomain, source) { const { adId, ad, adUrl, width, height } = adObject; if (adId) { - resizeRemoteCreative(adObject); + // resizeRemoteCreative(adObject); source.postMessage(JSON.stringify({ message: 'Prebid Response', ad, @@ -69,9 +69,11 @@ function sendAdToCreative(adObject, remoteDomain, source) { } function resizeRemoteCreative({ adUnitCode, width, height }) { + const allGoogleSlots = window.googletag.pubads().getSlots(); + const googleSlotObject = find(allGoogleSlots.filter(isSlotMatchingAdUnitCode(adUnitCode)), slot => slot); const iframe = document.getElementById( - find(window.googletag.pubads().getSlots().filter(isSlotMatchingAdUnitCode(adUnitCode)), slot => slot) - .getSlotElementId()).querySelector('iframe'); + googleSlotObject.getSlotElementId() + ).querySelector('iframe'); iframe.width = '' + width; iframe.height = '' + height; From c79cdc7f0bea1cee95d3517ed0fa62395f5c8e86 Mon Sep 17 00:00:00 2001 From: Flore Vallat Date: Wed, 8 Aug 2018 15:11:45 +0200 Subject: [PATCH 2/2] remove unused method --- src/secureCreatives.js | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/secureCreatives.js b/src/secureCreatives.js index 68714758f29..f6a2cf9fed7 100644 --- a/src/secureCreatives.js +++ b/src/secureCreatives.js @@ -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'; @@ -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, @@ -67,14 +65,3 @@ function sendAdToCreative(adObject, remoteDomain, source) { }), remoteDomain); } } - -function resizeRemoteCreative({ adUnitCode, width, height }) { - const allGoogleSlots = window.googletag.pubads().getSlots(); - const googleSlotObject = find(allGoogleSlots.filter(isSlotMatchingAdUnitCode(adUnitCode)), slot => slot); - const iframe = document.getElementById( - googleSlotObject.getSlotElementId() - ).querySelector('iframe'); - - iframe.width = '' + width; - iframe.height = '' + height; -}