阻止富媒体(Flash)广告更改页面上 CSS 元素的方法?

发布于 2024-11-28 10:24:05 字数 187 浏览 3 评论 0原文

我在我的网站上使用展示广告,我注意到某些可展开广告(当您将鼠标滑过时展开的广告)通过添加代码“可见性:隐藏”作为内联 CSS 更改了我页面上的一些元素。这会导致文本框和其他内容在广告加载时消失。除了简单地禁用有问题的广告(这不是一个好的解决方案,因为我永远不知道其他广告是否会导致问题),是否有办法阻止广告像这样将 CSS 指令注入我的网站?任何建议表示赞赏!

I use display advertising on my site and I noticed certain expandable ads (ads that expand when you roll over them) changes some of the elements on my page by adding the code "visibility: hidden" as inline CSS. This results in text boxes and other content disappearing when the ad loads. Other than simply disabling the offending ad (not a good solution since I never know what other ads might be causing problems or not), is there a way to block ads from injecting CSS instructions into my site like this? Any advice appreciated!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

濫情▎り 2024-12-05 10:24:05

Flash 添加可能正在使用 Flash 中的ExternalInterface 功能将 javascript 通过管道传输到您的页面:

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/external/ExternalInterface.html

最简单的方法要确保不会发生这种情况,请将嵌入广告的对象标记上的allowScriptAccess 设置为 false:

http://kb2.adobe.com/cps/164/tn_16494.html

如果您需要需要allowScriptAccess的功能(navigateToUrl来介意)然后事情会变得有点复杂:-)

It's likely the flash add is using the ExternalInterface feature in flash to pipe javascript to your page:

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/external/ExternalInterface.html

The easiest way to make sure this doesn't happen is to set allowScriptAccess to false on your object tag where the ad is embedded:

http://kb2.adobe.com/cps/164/tn_16494.html

If you need the functionality that require allowScriptAccess (navigateToUrl comes to mind) then things get a little bit more complicated :-)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文