I view a web site.
it include CSS, Javascript to detect ADBlock plugin
I can't write the rule
the site is:
www[.]ruanyifeng[.]com /blog/2018/12/async-api-design.html
CSS:
Javascript:
I using two rules:
ruanyifeng.com$$script[tag-content="checker"][max-length="100"]
www.ruanyifeng.com/blog/checker.js
But fail.
Anyone can help me write the rule,
it include CSS, Javascript to detect ADBlock plugin
I can't write the rule
the site is:
www[.]ruanyifeng[.]com /blog/2018/12/async-api-design.html
CSS:
HTML:
<style>
body {
background-color: #f5f5d5;
}
#container::before {
display: block;
width: 100%;
padding: 10px;
background: rgba(0,0,0,0.1);
text-align: center;
content: "本站显示不正常,可能因为您使用了广告拦截器。";
}
</style>
HTML:
<script type="text/javascript">
function checker() {
var img = document.querySelector('img[src^="http://www.ruanyifeng.com/blog/images"]');
if (img && window.getComputedStyle(img).display === 'none'){
var sponsor = document.querySelector('.entry-sponsor');
var prompt = document.createElement('div');
prompt.style = 'border: 1px solid #c6c6c6;border-radius: 4px;background-color: #f5f2f0;padding: 15px; font-size: 16px;';
prompt.innerHTML = '<p>您使用了广告拦截器,导致本站内容无法显示。</p><p>请将 www.ruanyifeng.com 加入白名单,解除广告屏蔽后,刷新页面,谢谢。</p>';
sponsor.parentNode.replaceChild(prompt, sponsor);
document.querySelector('#main-content').innerHTML = '';
}
}
setTimeout(checker, 1000);
</script>
ruanyifeng.com$$script[tag-content="checker"][max-length="100"]
www.ruanyifeng.com/blog/checker.js
But fail.
Anyone can help me write the rule,