javascriptgoogle-chromegoogle-dfpweb-developer-toolbar

javascript error on chrome :: Blocked a frame with origin "https://tpc.googlesyndication.com"


javascript error on chrome :: DOMException: Blocked a frame with origin "https://tpc.googlesyndication.com" from accessing a cross-origin frame. How to over come this situation. Site is available on https protocol. This iframe comming from googleDFP.


Solution

  • This is a CORS (Cross-Origin-Resource-Sharing) protection feature. It prevents your site from simulating button clicks or reading data from the embedded page. The embedded page is logged in, so it could contain sensitive data or buttons controlling state-changing actions.

    To stop this from happening, external pages from different origins will not be able to be access each other; unless they say so with their headers (or, if they are subdomains and have set their document.domain value)

    You might want to use a proxy site like https://crossorigin.me (which tends to be down alot). Or you could create your own proxy site. It needs to scrape the page, strip away the bad headers, and give it back.