view twitter-cleanup.user.js @ 53:28fde586a234

Add twitter anti-crap (part 1)
author nanaya <me@nanaya.pro>
date Sat, 30 Jun 2018 21:50:51 +0900
parents
children
line wrap: on
line source

// ==UserScript==
// @name         Twitter Cleanup
// @namespace    https://myconan.net
// @version      1.0.0
// @description  Strip out twitter craps (no, it doesn't turn the site blank)
// @author       nanaya
// @match        https://www.twitter.com/*
// @match        https://twitter.com/*
// @grant        none
// @downloadURL  https://bitbucket.org/!api/2.0/snippets/nanayapro/TK64/tip/files/twitter-cleanup.user.js
// ==/UserScript==

;(function() {
    "use strict";

    var $ = jQuery;
    var rules = [];
    var i;
    var styleEl;

    rules.push('[data-component-context="suggest_activity_tweet"] { display: none !important; }');

    for (i = 0; i < rules.length; i++) {
        styleEl = document.createElement('style');
        document.head.appendChild(styleEl);
        styleEl.sheet.insertRule(rules[i], 0);
    }
}).call();