Not working.
There is one thing I don't get.
I have 'Web developer' addon installed on my Chrome.
I can select the exact <div>, and then 'Hide' or 'Remove' it. I can even copy the entire <div>. So, if web developer can erase it, how couldn't anybody write a simple script to find the div and block it?
If you see FB Suggested Post Killer, by Eric Mintz, you can see what he is searching for, in order to block it :
Code: Select all
(function() {
'use strict';
// I predict FB will change this classname from time to time.
// ... so I have it in an easy-to-access variable here at the top.
// -----------------------------
// -- change me as needed
// -----------------------------
var divClass="_5jmm _5pat _3lb4 _59m _x72";
// -----------------------------
// Your code here...
var addListener = function(element,eventName,listener){
if(element.addEventListener){
element.addEventListener(eventName, listener);
}else{
element.attachEvent('on'+eventName, listener);
}
};
var killads = function(){
var divs = document.getElementsByClassName(divClass);
for (var i = 0; i < divs.length; i++){
var spans = divs[i].getElementsByTagName('span');
if (spans.length > 0 && spans[0].innerHTML == "Publicación sugerida"){
divs[i].remove();
}
}
};
addListener(document,'load',killads);
addListener(document,'DOMNodeInserted',killads);
})();
I've changed DivClass and innerHTML to mach the ones I've found in my own facebook.
OK, it's not working, and I've posted about it in author's webpage, but I'm sure his approach has some sense. The only thing you have to match is how can Web Developer delete or hide the ad.
I hope any of this could be useful to anybody.
###EDIT###
You can add these ones :
facebook.com##DIV[id^=“hyperfeed_”]._5jmm[data-dedupekey^=“5”]
facebook.com##DIV[id^=“hyperfeed_”]._5jmm[data-dedupekey^=“6”]
facebook.com##DIV[id^=“hyperfeed_”]._5jmm[data-dedupekey^=“7”]
facebook.com##DIV[id^=“hyperfeed_”]._5jmm[data-dedupekey^=“8”]
facebook.com##DIV[id^=“hyperfeed_”]._5jmm[data-dedupekey^=“9”]
facebook.com##DIV[id^=“hyperfeed_”]._5jmm[data-dedupekey^=“1”]
facebook.com##DIV[id^=“hyperfeed_”]._5jmm[data-dedupekey^=“2”]
facebook.com##DIV[id^=“hyperfeed_”]._5jmm[data-dedupekey^=“3”]
facebook.com##DIV[id^=“hyperfeed_”]._5jmm[data-dedupekey^=“4”]
And you'll see no ads, but you can't see the name of the people in a post, in the upper part, near his profile pic. Nice one by now.
Ok they show up, but then they dissapear.