This repository has been archived by the owner on Jan 24, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 90
Remove "More Tweets" widget on single tweet page #196
Labels
Comments
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: 8dd9df7 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
The text was updated successfully, but these errors were encountered: