Skip to content

Instantly share code, notes, and snippets.

@sh4869
Last active December 22, 2025 13:37
Show Gist options
  • Select an option

  • Save sh4869/d7dd13ddd968aaa8105a309ebb5ed410 to your computer and use it in GitHub Desktop.

Select an option

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==
const getEvent = (rect) => {
return {
bubbles: true,
cancelable: true,
view: window,
clientX: rect.left + rect.width / 2,
clientY: rect.top + rect.height / 2,
screenX: window.screenX + rect.left + rect.width / 2,
screenY: window.screenY + rect.top + rect.height / 2
};
}
(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].children[0];
const e = getEvent(home.getBoundingClientRect())
home.dispatchEvent(new MouseEvent("click", e))
dom.children[0].remove();
}
}, 1500);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment