How to make a Adblocker detector in Javascript?

Why does placing a JavaScript pixel within an iFrame make the JavaScript pixel more secure?

  • I understand that advertisers are often concerned about javascript pixels, because JavaScript pixels can make numerous calls. Why does putting it into an iFrame make it more secure? Can't JavaScript being run within an iFrame affect the host page?

  • Answer:

    If pixels are served from an iFrame from a different host, then the HTTP referrer header sent along with the pixel request is the URL of the iFrame, not the URL of the page. At TellApart, we drop third party ad network pixels on our partner sites who are e-commerce retailers. Some retailers are concerned about not leaking information about their traffic pattern to third party ad networks. By dropping pixels from an hidden iFrame served from a http://tellapart.com domain, all we leak to the ad network is the http://tellapart.com domain, not the merchant's domain.

Mike Cui at Quora Visit the source

Was this solution helpful to you?

Other answers

The host page can only reference internal state via javascript in an iFrame or vice versa if both are from the same domain.  If they are different domains (e.g one is an advertiser's domain), then the two cannot access each other's state.  See this article http://softwareas.com/cross-domain-communication-with-iframes for a good description of the security limitations.

John Friend

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.