您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
Automatically switch to 'Following' section when visit Twitter homepage.
当前为
// ==UserScript== // @name Shows latest tweet // @namespace http://greasyfork.icu/users/57176 // @match https://twitter.com/** // @match https://x.com/** // @icon https://abs.twimg.com/favicons/twitter.2.ico // @grant none // @version 1.0.5 // @author peng-devs // @description Automatically switch to 'Following' section when visit Twitter homepage. // @allFrames true // @license MIT // ==/UserScript== const NAME = 'show-latest-tweet' function main() { const xpath = "//span[contains(text(), 'Following')]" const observer = new MutationObserver((_, observer) => { if (document.location.pathname !== '/home') return const span = document.evaluate(xpath, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue if (!span) return console.log(`[${NAME}] 'Following' found`, span) span.click() observer.disconnect() }) observer.observe(document.body, { childList: true, subtree: true }) } main()