Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
function findForDisabling(searchTerm){
$(searchTerm).each(disableDisplay);
}
function disableDisplay(index, element){
element.style.display = 'none';
}
window.setInterval(function(){
var searches = ["#feed", ".watch-sidebar", "#watch-discussion", ".feed-item-container"];
searches.forEach(findForDisabling);
}, 3000);
@khalidaxamd

This comment has been minimized.

Copy link

@khalidaxamd khalidaxamd commented Jul 13, 2017

function findForDisabling(searchTerm){

  | $(searchTerm).each(disableDisplay);
  | }
  |  
  | function disableDisplay(index, element){
  | element.style.display = 'none';
  | }
  |  
  | window.setInterval(function(){
  | var searches = ["#feed", ".watch-sidebar", "#watch-discussion", ".feed-item-container"];
  | searches.forEach(findForDisabling);
  | }, 3000);

@afzaledx

This comment has been minimized.

Copy link

@afzaledx afzaledx commented Jan 1, 2018

I had to modify the selectors (line 10):
var searches = ["#related", "#comments"];

@mikenuttall

This comment has been minimized.

Copy link

@mikenuttall mikenuttall commented Sep 9, 2018

Added a clearInterval so it's not running continually

And added #contents - gets rid of all the "recommended for you" stuff

And got rid of the "Trending" button - another wasteland!

function findForDisabling(searchTerm){
    $(searchTerm).each(disableDisplay);
}

function disableDisplay(index, element){
    element.style.display = 'none'; 
}

var destroyRabbitHoles = window.setInterval(getRabbitHoles, 3000);

var count = 0;
function getRabbitHoles(){
    var searches = [
                     "#feed", 
                     ".watch-sidebar", 
                     "#watch-discussion", 
                     ".feed-item-container",
                     "#related", 
                     "#comments",
                     "#contents"
              ];
    searches.forEach(findForDisabling);  
    if(count++ > 2){
        clearInterval(destroyRabbitHoles);
    }
}

var trendingButton = document.querySelector("a[title=Trending]");

if( trendingButton !== null){
    trendingButton.style.display = 'none';
}    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment