Last active
January 13, 2018 14:13
-
-
Save notyal/15af5f6bf883267cc407f5aa2adeeedd to your computer and use it in GitHub Desktop.
This file contains 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 Fix XDA Sponsored Posts | |
// @namespace https://gist.github.com/notyal/15af5f6bf883267cc407f5aa2adeeedd | |
// @version 1.0 | |
// @description Make it easier to skim through the actual XDA blog posts. | |
// @author Layton Nelson | |
// @match https://www.xda-developers.com/* | |
// @grant none | |
// @downloadUrl https://gist.github.com/notyal/15af5f6bf883267cc407f5aa2adeeedd/raw/fix-xda-sponsored-posts.user.js | |
// @updateURL https://gist.github.com/notyal/15af5f6bf883267cc407f5aa2adeeedd/raw/fix-xda-sponsored-posts.user.js | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
for (let metadata of document.body.querySelectorAll("a.article-meta-data")) { | |
if (metadata.href.endsWith('a-word-from-our-sponsors/')) { | |
let post = metadata.parentNode.parentNode.parentNode.parentNode; | |
// dim the post | |
post.style.opacity = '0.2'; | |
// remove the post | |
// post.style.display = 'none'; | |
} | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This doesn't remove posts from the XDA Commerce team, which seem to be the current equivalent of the sponsored stuff.
swapping the href a-word-from-our-sponsors to
if (metadata.title.endsWith('Posts by XDA Commerce Team'))
works, however.