大约40%的网络用户使用广告拦截工具,这会显著降低广告收入。我们提供了一套Adblock API,让您能够提示使用广告拦截的用户来支持网站。 Roughly 40% of web users use adblock, which can significantly reduce ad revenue. We offer an Adblock API which enables you to prompt adblock users to support the site. 该API作为独立模块提供,只需在页面中额外引入一个script标签即可启用。该模块设计轻量、加载迅速,gzip压缩后体积不足0.3kB,且无任何外部依赖。 This API is available as a separate module that you can add to your site by including an additional script tag. We designed this module to be fast and lightweight, with a gzipped size of under 0.3 kB and requiring no external dependencies.Documentation Index
Fetch the complete documentation index at: https://docs.rev.iq/llms.txt
Use this file to discover all available pages before exploring further.
启用Adblock API模块 Enable Wrapper Adblock API
将以下Adblock API模块代码添加到网页的<head>标签中。我们为其添加了id,方便您识别其用途
Add the Adblock API Module code to the <head> section of your webpage. We put an id so you can remember what
it’s for :)
使用Adblock API Using the Adblock API
注意:这些函数不应通过命令队列(
reviq.push(cmd))调用。Adblock API
模块加载完成后,这些函数即可立即使用。 Note: You should NOT use the
command queue (reviq.push(cmd)) for these functions. These functions are
always available immediately after the Adblock API Module is loaded.showAdblockModal的函数,用于向用户显示弹窗,提示其关闭广告拦截。
Suppose you have some function showAdblockModal that shows a modal asking
users to disable adblock.
reviq.onAdblock(cb): 检测到广告拦截时,执行回调函数cb runs a callback cb if adblock is detected
checkAdblock():需配合await使用,检测到广告拦截时返回true,否则返回false must be awaited and returns true if adblock is detected, false otherwise