0

I know this is not allowed by google, and i can get my adsense acount banned but i will take the risks :D

The scenario is: Google gives you a script to put in your page.

<script type="text/javascript">
 google_ad_client = "ca-pub-xxxxxxxxxxxx";
 google_ad_slot = "xxxxxx";
 google_ad_width = 300;
 google_ad_height = 250;
</script>
<script type="text/javascript" src="//pagead2.googlesyndication.com/pagead/show_ads.js"></script>
When page loads it generates an add! Here is a link, so you can inspect the add:

When the page loads, this script generates an iframe, we will call it iframe A

Iframe A contains contains a html page with 2 iframes in it, we will call it iframe B and iframe C. So far we have an iframe that contains 2 iframes inside. The second iframe, iframe C, contains a link.

All I want to do is "To open the link in new tab" :D

I can do this by adding with javascript attribute target="_blank".. BUT i CANT select the link() with javascript because the iframe is from another site. For security reasons browsers dont let you to access the content of an iframe if is not from your site.

I am loking for some sort of a hack... I was thinking if playing with events will help me ?

Like catching the event of link click, than stop the event and than fire new event to open link in new tab.

Or catch the leftclick event, stop event, fire right click event than, from the cotext menu select "open link in new tab" (all of this happens when user leftclick the link)

Any suggestions are welcome, I need to look this problem from a different perspective...

  • Your code won't be able to do anything with the iframes. Browsers are explicitly hardened to prevent that. If you were to somehow find a way to do it, that would be reported as a critical security flaw and patched within days. – Pointy Feb 22 '15 at 03:34
  • Can i build a proxy on my domain, so i can load the page from the other domain on my server, and feed it to the client as if it was from my domain? I could even add the target="_blank" to the HTML code in the server? – Luan Anamalaj Feb 22 '15 at 03:37
  • Let's think about this: you're trying to outsmart **Google**. If you were a gambler, would you bet on that working out successfully? – Pointy Feb 22 '15 at 03:38
  • Let 's think about it: what makes google the best company in the world? The people who work for google! They are talented! But i think that they are not the only talented people in the world, the comunity here is so talented! There is always a way to hack. – Luan Anamalaj Feb 22 '15 at 03:42

0 Answers0