From aed272fd6005c10db0fb5f2ced8822df4961ac0e Mon Sep 17 00:00:00 2001 From: John Ellis Date: Wed, 21 Nov 2018 10:52:26 -0500 Subject: [PATCH] YieldbotBidAdapter to use implicit document open via write (#3313) --- modules/yieldbotBidAdapter.js | 2 +- test/spec/modules/yieldbotBidAdapter_spec.js | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/yieldbotBidAdapter.js b/modules/yieldbotBidAdapter.js index a18448a0b0b..15b5cf34f96 100644 --- a/modules/yieldbotBidAdapter.js +++ b/modules/yieldbotBidAdapter.js @@ -369,7 +369,7 @@ export const YieldbotAdapter = { const adUrl = this.buildAdUrl(urlPrefix, publisherNumber, commonSearchParams, bid); const impressionUrl = this.buildImpressionUrl(urlPrefix, publisherNumber, commonSearchParams); - const htmlMarkup = `
`; + const htmlMarkup = `
`; return { ad: htmlMarkup, creativeId: ybotAdRequestId }; }, diff --git a/test/spec/modules/yieldbotBidAdapter_spec.js b/test/spec/modules/yieldbotBidAdapter_spec.js index 2977e4ef30d..3f78d4aa688 100644 --- a/test/spec/modules/yieldbotBidAdapter_spec.js +++ b/test/spec/modules/yieldbotBidAdapter_spec.js @@ -1059,6 +1059,16 @@ describe('Yieldbot Adapter Unit Tests', function() { expect(edgeServerUrlPrefix).to.match(beginsRegex); expect(responses[0].ad).to.match(containsRegex); }); + + it('should not use document.open() in ad markup', function() { + FIXTURE_SERVER_RESPONSE.body.url_prefix = 'http://close.edge.adserver.com/'; + const responses = YieldbotAdapter.interpretResponse( + FIXTURE_SERVER_RESPONSE, + FIXTURE_BID_REQUEST + ); + expect(responses[0].ad).to.not.match(/var innerFrameDoc=innerFrame\.contentWindow\.document;innerFrameDoc\.open\(\);innerFrameDoc\.write\(iframeHtml\);innerFrameDoc\.close\(\);/); + expect(responses[0].ad).to.match(/var innerFrameDoc=innerFrame\.contentWindow\.document;innerFrameDoc\.write\(iframeHtml\);innerFrameDoc\.close\(\);/); + }); }); describe('getUserSyncs', function() {