Closed fasenderos closed 3 years ago
Does this have ramifications for non-amp implementations of prebid? otherwise, I'm not entirely surprised that .js encounters issues in an amp environment especially with amp's iframe work. @bretg what do you think?
A PR implementing some large number of max iterations in referee discovery would be fine.
We will not be attempting to make Prebid.js work with AMP, though I suppose if someone finds a way better than AMP RTC, that would be interesting.
@bretg if you give me some hints on what do you mean for “large number” (50? 100? 1000? or more?) I can make a PR for that.
Seems to me like 10 levels of iframes would be absurd.
But the Prebid Way is to make things configurable because someone out there has 12 nested iframes. So how about setConfig({maxNestedIframes})?
Sounds good to me. I’ll make a PR in the next days
closing issue with the submission of pr #6615
Hi, I had problems with Prebid and AMP. I can see from the terminal that
prebid.js
is loaded, but no request is sent toappnexus
. After reading your docs, I discovered that AMP restricts header bidding wrappers like Prebid.js and that I have to create a (or to sign up for a hosted solution of)Prebid Server
and using the AMP RTC Config.Anyway, it seemed really strange to me that
prebid.js
is correctly loaded on page and nothing happens without raising any errors. After a lot of debugging I found out why. Prebid ends in an endless loop and AMP kills the process.The loop is generated by the function
refererInfo()
in refererDetection.js because under AMPcurrentWindow
is always different thanwin.top
. https://github.com/prebid/Prebid.js/blob/42182d6c1844ebc012f3536da3670bc14f75b5db/src/refererDetection.js#L164I understend that this function try to traverse the DOM to find the windows top, but I don't know if it was intended to have a
do while
without an escape strategy (e.g. max 100 iterations)In my case the
foundReferrer
pushed in thestack
array was for the 1st iteration theampproject
url, than the url of my site and thennull
. And so on following the same patternSo to solve this specific problem it was enough to force the exit from the loop at the 2nd iteration
while (currentWindow !== win.top && level < 2)
- I know i can make a better condition, but this is not the place to talk about that.After that prebid started working as usual, and the
referrer_detection.rd_ref
sent to appnexus has the right referer.My concerns now are:
prebid.js
?Thanks in advance.