Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function() {
- 'use strict';
- /*Script create by kiki67100 remove facebook ads */
- function CheckFacebookAds(){
- jQuery('a[href*="/ads/about"]').each(function(){
- var i=0,
- last_parent,
- last_parent_height,
- tmp_el=$(this),
- height;
- for(i=0;i<30;i++){
- tmp_el=$(tmp_el).parent();
- height=$(tmp_el).height();
- if( (height-last_parent_height) > 500 ){
- console.log("Height > 500 out of ads remove the last_parent");
- console.log(last_parent);
- $(last_parent).remove();
- break;
- }
- last_parent=$(tmp_el);
- last_parent_height=height;
- console.log("parent n [",i,"] = height() = ",height);
- }
- });
- }
- setInterval(function(){
- CheckFacebookAds();
- },3000);
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement