0

The page I made is shown on an someone else's server in what seems to be a 100% wide iframe with JavaScript ads over it. Can I disable the ads changing the code of my page?

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
  • 1
    You might want a [framebuster](http://stackoverflow.com/search?q=framebuster) instead? – yunzen Apr 23 '14 at 14:36
  • you mean http://stackoverflow.com/questions/194346/force-iframe-to-load-full-frame ? – gtryonp Apr 23 '14 at 14:41
  • Vice-versa would work if you display *remote* page in *your* site's iframe - you can restrict what iframe can do via `sandbox` attribute. But you cannot affect remote parent page running your page in an iframe – Yuriy Galanter Apr 23 '14 at 14:44
  • You could prevent you page to be iframed with [X-Frame-Options header](https://developer.mozilla.org/en-US/docs/Web/HTTP/X-Frame-Options) – Alexey Ten Apr 23 '14 at 14:52

1 Answers1

1

No. JavaScript is running client-side (in the browser), so you have no possibilities to disallow that.


But what you can do is: you can prevent being iframed by this ad site and all other sites with some tricks, also in JavaScript. See here: Prevent iframe stealing

Community
  • 1
  • 1
Robert
  • 1,286
  • 1
  • 17
  • 37