是否可以检测我页面的 Google Adsense 内容?

Is it possible to detect the content of my page's Google Adsense?

假设我有一个博客,运行 Google 广告。

而且我拥有该博客的完全控制权。它没有托管在其他地方。

我是否可以检测向我的读者展示的广告内容?例如,如果显示关键字 Quora,我想删除广告。

我试过这个: How to get the body's content of an iframe in Javascript?

但是我无法将 HTML 取出来。

...detect the content of the ads that's been displayed ... I want to remove the ads

除了技术解释外,我认为隐藏广告发布商发送给用户的广告是不道德的。因为广告发布商会认为广告正在展示。广告所有者将为该广告付费,您将从中赚钱。换句话说,您无法在放置到页面并显示后隐藏广告。

在我看来 Adsense 用户必须尊重广告平台关于展示​​什么广告的决定。因为Adsense和用户之间的约定是这样的。

但是,如果Google Adsense 提供了将某些词列入黑名单的选项,您可以使用它。我想,这就是你需要的。

希望这对您有所帮助。

P.S.: 也许 Adsense 支持可以帮助您解决黑名单问题。你试过联系他们吗?


更新

我找到了一篇关于根据某些规则(URL、广告网络等)屏蔽广告的文章(有视频说明)

Is it possible for me to detect the content of the ads that's been displayed to my readers?

这是不可能的,因为 Cross-origin resource sharing (CORS) rules:

Cross-origin resource sharing (CORS) is a mechanism that allows restricted resources on a web page to be requested from another domain outside the domain from which the first resource was served. A web page may freely embed cross-origin images, stylesheets, scripts, iframes, and videos. Certain "cross-domain" requests, notably Ajax requests, are forbidden by default by the same-origin security policy.

Read full article in the link above.

Google Adsense 广告将使用 JavaScript 文件创建,该文件不在您的服务器上。

如何屏蔽广告(答案来自 Google Adsense 支持)

您可以在“广告查看中心”屏蔽广告。引自官方 Google Adsense support site:

Ad review center overview

The Ad review center is a feature that gives you more transparency and control over the ads that appear on your site. When you enable the Ad review center, you can review individual ads after they're shown and assess whether you want to continue showing them on your pages.

Some important things to know about the Ad review center:

  • You can find it on the Allow & block ads page in your AdSense account
  • It supports ads of all targeting types (contextual, personalized, and placement)
  • You can use its filter and search functions to help you find ads to review and block
  • It doesn't support all AdSense products
  • You can only block ads at the product level, not on a site-by-site basis

For help getting started with the Ad review center, see our guide to reviewing ads.

你也可以这样做: Block ads by general category: at the site level or at the product level

重要信息:上面这个链接中的每一个你都可以用你的语言(例如中文)阅读。您可以在每个页面的底部更改语言。