Last active
August 13, 2024 02:43
-
-
Save sh4869/d7dd13ddd968aaa8105a309ebb5ed410 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 おすすめタブを物理的に消す | |
// @namespace http://tampermonkey.net/ | |
// @version 2024-07-05 | |
// @description オススメタブがあると1.5sに一回消します | |
// @author You | |
// @match https://x.com/* | |
// @match https://twitter.com/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=x.com | |
// @grant none | |
// ==/UserScript== | |
(function () { | |
"use strict"; | |
const selector = "[data-testid=ScrollSnap-List]" | |
setInterval(() => { | |
if(location.pathname !== "/home"){ | |
return | |
} | |
const dom = document.querySelector(selector); | |
if (dom && dom.children.length === 3) { | |
const home = dom.children[1]; | |
dom.children[0].remove(); | |
setTimeout(() => { | |
document.querySelector(selector).children[0].click(); | |
}, 1000); | |
} | |
}, 1500); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment