问题
My Facebook and Twitter images/links are not displaying when Adblock Plus is enabled in Chrome. I removed the titles for when you hover over the images, and they were no longer blocked. Is there a way I can keep the titles without Adblock Plus blocking them?
Here's what I have when they're blocked:
<div class="row mar20">
<div class="col-xs-6">
<div class="img-responsive">
<a href="https://facebook.com/RiskyBeeGame" title="Facebook">
<img src=WebF.png class="pull-right">
</a>
</div>
</div>
<div class="col-xs-6">
<div class="img-responsive">
<a href="https://twitter.com/riskybeegame" title="Twitter">
<img src=WebT.png>
</a>
</div>
</div>
回答1:
Adblockers block page elements based on the properties of the element. As you discovered, element id's, classes, titles, etc. can all be used to filter 'unwanted' page elements.
It sounds like you've already figured out how to evade the standard detection by removing the title of the link.
It's not clear why you want to keep the title tag.
If you're interested in the popup tooltip -- your best bet is to use one of hundreds of Jquery tooltip scripts.
If you need the title tags because of some other script on your page which hooks into the title attribute, you can add the title attribute dynamically onload:
document.getElementById('mytwitterlink').setAttribute('title','Twitter');
That may or may not get past the adblocker, depending on the adblocker...
Your best bet would really be to alter any scripts that look for the title attribute "Twitter" and change them to look for something else...
来源:https://stackoverflow.com/questions/38341769/adblock-plus-is-blocking-my-social-media-links