Safe renderer#6585
Conversation
✅ Deploy Preview for prebid-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
| * Reference implementation for `bid.safeRenderer.url`. | ||
| * Prebid injects this script into the creative iframe and then calls `window.pbRenderInFrame(payload)`. | ||
| */ | ||
| window.pbRenderInFrame = function ({ mediaType, config, ...renderingData }) { |
There was a problem hiding this comment.
I find this a bit confusing, because you are partially destructuring here and then describe the params below, but leave out the config .
Is config missing from renderingData data? Or is config actually its own parameter? Or is it the safeRenderer parameter?
The renderer.js in the related pbjs PR states
The remote script must assign
window.pbRenderInFrameas a function.
payloadis{ config: safeRenderer.config, ...renderingData }:renderingDatacarries bid-oriented ields passed through the creative pipeline
that may matter to an external renderer—for examplead,adId,adUrl,vastXml,vastUrl,mediaType, sizes,instl.
payload.configmirrorssafeRenderer.configfrom that payload; before the creative runs, Core may populate it from a static
safeRenderer.config(e.g. set on the bid by the bidder adapter) or by calling the publisher’ssafeRenderer.getConfig(bidResponse)once at render preparation.
So I guess config = safeRenderer.config , but it should be stated below in the table
There was a problem hiding this comment.
yes, this object comes from safeRenderer.config - publishers can provide it by defining safeRenderer.getConfig(bidResponse)
There was a problem hiding this comment.
destructuring mediaType from renderingData may be misleading here. Could be just ({config, ...renderingData})
There was a problem hiding this comment.
Sounds good. Will you make the change 😊 ?
Co-authored-by: Muki Seiler <muuki88@users.noreply.github.com>
…rebid.github.io into mkomorski/safe-renderer
Adding new safe renderer to "Renderer" section
🏷 Type of documentation
📋 Checklist
prebid/Prebid.js#14756