Skip to content

Commit

Permalink
Core: update creative code and example (#11350)
Browse files Browse the repository at this point in the history
  • Loading branch information
dgirardi authored Apr 18, 2024
1 parent 08ac74f commit ed7e942
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion integrationExamples/gpt/x-domain/creative.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// creative will be rendered, e.g. GAM delivering a SafeFrame

// this code is autogenerated, also available in 'build/creative/creative.js'
<script>!function(){"use strict";var e=JSON.parse('{"FP":{"h0":"adRenderFailed","gV":"adRenderSucceeded"},"q_":{"XW":"exception"},"X3":{"Z":"Prebid Request","YC":"Prebid Response","Ks":"Prebid Event"}}');const n=e.X3.Z,t=e.X3.YC,r=e.X3.Ks,s=e.FP.h0,o=e.FP.gV,i=e.q_.XW,a=(()=>{const e={frameBorder:0,scrolling:"no",marginHeight:0,marginWidth:0,topMargin:0,leftMargin:0,allowTransparency:"true"};return(n,t)=>{const r=n.createElement("iframe");return Object.entries(Object.assign({},t,e)).forEach((([e,n])=>r.setAttribute(e,n))),r}})();var c;window.pbRender=(c=window,function({adId:e,pubUrl:d,clickUrl:l}){const g=new URL(d,window.location).origin;function u(n,t,r){const s=new MessageChannel;s.port1.onmessage=f(r),c.parent.postMessage(JSON.stringify(Object.assign({message:n,adId:e},t)),g,[s.port2])}function p(e){u(r,{event:s,info:{reason:e?.reason||i,message:e?.message}}),e?.stack&&console.error(e)}function f(e){return function(){try{return e.apply(this,arguments)}catch(e){p(e)}}}u(n,{options:{clickUrl:l}},(function(n){let s;try{s=JSON.parse(n.data)}catch(e){return}if(s.message===t&&s.adId===e){const e=a(c.document,{width:0,height:0,style:"display: none",srcdoc:`<script>${s.renderer}<\/script>`});e.onload=f((function(){const n=e.contentWindow;n.Promise.resolve(n.render(s,{sendMessage:u,mkFrame:a},c)).then((()=>u(r,{event:o})),p)})),c.document.body.appendChild(e)}}))})}();</script>
<script>!function(){"use strict";const e="Prebid Event",n=(()=>{const e={frameBorder:0,scrolling:"no",marginHeight:0,marginWidth:0,topMargin:0,leftMargin:0,allowTransparency:"true"};return(n,t)=>{const r=n.createElement("iframe");return Object.entries(Object.assign({},t,e)).forEach((([e,n])=>r.setAttribute(e,n))),r}})();var t;window.pbRender=(t=window,function({adId:r,pubUrl:s,clickUrl:o}){const i=new URL(s,window.location).origin;function a(e,n,s){const o=new MessageChannel;o.port1.onmessage=d(s),t.parent.postMessage(JSON.stringify(Object.assign({message:e,adId:r},n)),i,[o.port2])}function c(n){a(e,{event:"adRenderFailed",info:{reason:n?.reason||"exception",message:n?.message}}),n?.stack&&console.error(n)}function d(e){return function(){try{return e.apply(this,arguments)}catch(e){c(e)}}}a("Prebid Request",{options:{clickUrl:o}},(function(s){let o;try{o=JSON.parse(s.data)}catch(e){return}if("Prebid Response"===o.message&&o.adId===r){const r=n(t.document,{width:0,height:0,style:"display: none",srcdoc:`<script>${o.renderer}<\/script>`});r.onload=d((function(){const s=r.contentWindow;s.Promise.resolve(s.render(o,{sendMessage:a,mkFrame:n},t)).then((()=>a(e,{event:"adRenderSucceeded"})),c)})),t.document.body.appendChild(r)}}))})}();</script>

<script>
pbRender({
Expand Down

0 comments on commit ed7e942

Please sign in to comment.