HTML5のレスキュー!
ちょうどあなたのiframeにこれを追加します。
sandbox="allow-scripts"
このiframeのサンドボックス機能では、ページをリダイレクトするか、いずれかのトップのフレームナビゲーションを実行することからiframe内に何かを防ぐことができます。
したい一つの値は次のとおりです。あなたがしたくない
allow-scripts - Allows script execution
他の三つのサンドボックスのオプションは次のとおりです。
allow-same-origin - Allows the iframe content to be treated as being from the same origin as the containing document
allow-forms - Allows form submission
allow-top-navigation - Allows the iframe content to navigate (load) content from the containing document
完全に 'サンドボックス' のiframe:
sandbox=""
完全対応iframe:
sandbox="allow-scripts allow-forms allow-same-origin allow-top-navigation"
(または単にプロパティを省略する)
「allowscriptaccess = "never" for embed/object tags」のようなものです。 – kirilloid
これをiframeタグまたはembedタグに追加すると、ほとんどの広告会社がFlash広告を呼び出すためにjavascriptを使用するため、Flash広告がまったく実行されなくなります。 – User
要約すると、実際にはすべての広告が機能しなくてもこれを行う方法はありません。 – User