Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

AngerDanger

Graphics
Original poster
Staff member
Dec 9, 2008
5,452
29,006
I've written a script that allows users to block front page articles by keyword. I figured this would save users, moderators, and editors a bit of headache.

You'll need an extension so that your browser can run the script (user scripts allow your browser to run custom JavaScript files on webpages). Below is a series of links to Tampermonkey, a user script extension supported by many browsers:

This code will need to be copied and pasted into a new user script. By default, it's set to block articles with "Carpool Karaoke," "Samsung," and "Beta" in the title. Add to or remove these words to block whatever you want:

Code:
// ==UserScript==
// ==UserScript==
// @name         iDontCare
// @namespace    http://angerdanger.com
// @version      0.1
// @description  Hide Unwanted MR Articles
// @author       AngerDanger
// @match        https://www.macrumors.com/
// @grant        none
// ==/UserScript==

window.onload = function(){
    var keywords = ["Carpool Karaoke", "Samsung", "Beta"]; // <-- EDIT THESE KEYWORDS
    var titles = document.getElementsByClassName('title');
    for (var j = 0; j < keywords.length; j++){
        for (var i = 0; i < titles.length; i++){
            if (titles[i].innerHTML.indexOf(keywords[j]) >= 0){
                titles[i].parentNode.parentNode.removeChild(titles[i].parentNode);
                i--;
            }
        }
    }
};

Caveats
  • The script runs after the page has loaded, so there will be a moment where you're able to see the articles before they poof out of existence.
  • You'll still see blocked articles on mobile browsers.
  • This won't block any articles from being pushed as notifications.
 
Last edited:
Works pretty well under Firefox, but another caveat I see is it can't do anything about the sidebar stories so far. Lots of iffy articles seem to always get tucked away in there.
 
D1
I also grew up with newspapers and magazines so I
[continued on page D5]

D5
[continued from page D1]
also just skip the articles that don't interest me.
Screen Shot 2017-08-08 at 6.02.19 PM copy.png
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.