UpYoursFB

Hide Facebook Ads

  1. // ==UserScript==
  2. // @name UpYoursFB
  3. // @namespace upyoursfb
  4. // @description Hide Facebook Ads
  5. // @author d4rk3rnigh7
  6. // @include *://*.facebook.com/*
  7. // @require https://code.jquery.com/jquery-3.2.1.min.js
  8. // @version 1.9.3
  9. // @license CC
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. $(document).ready(function(){
  14. var upyours = ['Suggested Offer', 'Suggested Post', 'Featured For You', 'A Video You May Like'];
  15. $(document).on('scroll', function(){
  16. // For Desktop
  17. if(window.location.href.indexOf('www.facebook') !== -1){
  18. $('span').each(function(){
  19. if($.inArray($(this).text(), upyours) !== -1){
  20. $(this).parents().eq(4).hide();
  21. //console.log('Got another one | Up yours fb');
  22. }
  23. });
  24. }
  25. // For Mobile
  26. else{
  27. $('header').each(function(){
  28. if($.inArray($(this).text(), upyours) !== -1){
  29. $(this).parents().eq(1).hide();
  30. //console.log('Got another one | Up yours fb');
  31. }
  32. });
  33. }
  34. });
  35. });