Last active
May 14, 2018 00:03
-
-
Save jdeblese/5b600e376979c474ce3842646318b58a to your computer and use it in GitHub Desktop.
Remove ads, posts, blogs, and other annoyances from Quora feed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Clean Quora | |
// @namespace http://www.thescrapyard.org/ | |
// @version 0.2 | |
// @description Remove blog posts from Quora feed | |
// @author You | |
// @match https://www.quora.com/ | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
function killpost(post) { | |
while (!post.classList.contains('outer_content_box') && !post.classList.contains('feed_story') && !post.classList.contains('FeedStory') && !post.classList.contains('HyperLinkFeedStory') && !post.classList.contains('AdBundle') && !post.classList.contains('AdStory') && !post.classList.contains('InteractionModeBanner')) | |
post = post.parentElement; | |
post.parentElement.removeChild(post); | |
return 1; | |
} | |
function clean() { | |
Array.from(document.getElementsByClassName('PostBoardItemView')).filter(killpost); | |
Array.from(document.getElementsByClassName('HyperLinkFeedStory')).filter(killpost); | |
Array.from(document.getElementsByClassName('promoted_weblink')).filter(killpost); | |
} | |
setInterval(clean, 1000); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment