Unable to access contents of a safeframe returned by Google adx

落花浮王杯 提交于 2019-12-11 06:31:52

问题


  1. I work in adtech company and have a problem when i try and access an safeframe returned by google adx

  2. I need to get a href or img inside the safeframe to check if ad is coming or not as if to find if anything is coming or no ad is being sent.

  3. When i try and access the contents of the safeframe I get error:-

Uncaught DOMException: Failed to read the 'contentDocument' property from 'HTMLIFrameElement': Blocked a frame with origin "http://www.somerandomname.com" from accessing a cross-origin frame.

What should i do in this case as finding out if no ad or ad is returning is important in business sense.


回答1:


That's not possible, because of iframe content is on different domain.

But DFP is smart enought. When you have ADX intergrated in your DFP, you can create conditions, that will prioritise ADX ads here:

More about it here: https://support.google.com/adxseller/answer/6300696?hl=en https://support.google.com/adxseller/topic/3376095?hl=en&ref_topic=2911899



来源:https://stackoverflow.com/questions/42158195/unable-to-access-contents-of-a-safeframe-returned-by-google-adx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!