Closed ahmetb closed 3 years ago
Agreed. PR welcome :)
I definitely lack the JS skills to do that.
Yo this would be amazing
Find a userscript from Reddit that works.
// ==UserScript==
// @name RIP "More Tweets"
// @version 1.0.0
// @grant none
// @run-at document-start
// @match *://*.twitter.com/*/status/*
// ==/UserScript==
//https://stackoverflow.com/a/12222317
var cssPath = function(el) {
if (!(el instanceof Element))
return;
var path = [];
while (el.nodeType === Node.ELEMENT_NODE) {
var selector = el.nodeName.toLowerCase();
if (el.id) {
selector += '#' + el.id;
path.unshift(selector);
break;
} else {
var sib = el,
nth = 1;
while (sib = sib.previousElementSibling) {
if (sib.nodeName.toLowerCase() == selector)
nth++;
}
if (nth != 1) {
// Build "n+X" directly here
if (path.length === 0) {
selector += ":nth-of-type(n+" + nth + ")";
} else {
selector += ":nth-of-type(" + nth + ")";
}
}
path.unshift(selector);
el = el.parentNode;
}
return path.join(" > ");
}
}
function rmMo() {
var moTweets = [...document.querySelectorAll('span')].find(el => el.innerHTML === "More Tweets");
if (moTweets) {
var moContainer = moTweets.parentNode.parentNode.parentNode.parentNode.parentNode;
pt = cssPath(moContainer);
var sheet = window.document.styleSheets[0];
sheet.insertRule(`${pt} { display: none; }`, sheet.cssRules.length);
window.clearInterval(intval);
}
}
intval = window.setInterval(rmMo, 200);
Closing as this extension is now deprecated: https://github.com/sindresorhus/refined-twitter/commit/8dd9df749d3a4e82c95b2bd6628c8d65f0f72e6c
Twitter just added a very confusing More Tweets section to individual tweet pages, showing "similar" tweets. Totally useless. Let's refine.
e.g. screenshot from https://twitter.com/stroughtonsmith/status/1237037972526071808