Skip to content

Instantly share code, notes, and snippets.

@sh4869
Last active August 13, 2024 02:43
Show Gist options
  • Save sh4869/d7dd13ddd968aaa8105a309ebb5ed410 to your computer and use it in GitHub Desktop.
Save sh4869/d7dd13ddd968aaa8105a309ebb5ed410 to your computer and use it in GitHub Desktop.
// ==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