您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Stop clicking tweet impressions accidentally
// ==UserScript== // @name Put Twitter's Like button where it belongs // @namespace https://github.com/arshxyz/twitterswitchback // @version 1.0 // @description Stop clicking tweet impressions accidentally // @author github.com/arshxyz // @match https://twitter.com/home // @icon https://raw.githubusercontent.com/arshxyz/twitterswitchback/main/revlogo.png // @grant none // @license MIT // ==/UserScript== (function () { function update(node) { function swapNodes(node1, node2) { const temp = document.createComment('') node2.replaceWith(temp) node1.replaceWith(node2) temp.replaceWith(node1) } let twt = node.querySelectorAll("article[data-testid='tweet']") if (twt.length == 0) return; twt.forEach((tweet) => { let icongroup = tweet.querySelector("div[role='group']") let icons = icongroup.childNodes // check for tweet view where views is shown in different group if (icons.length == 1) return; // check if already swapped if (icons[3].querySelectorAll("div[data-testid='like']").length > 0|| icons[3].querySelectorAll("div[data-testid='unlike']").length > 0) return; // bubble viewcount icon to the left swapNodes(icons[2], icons[3]) swapNodes(icons[1], icons[2]) swapNodes(icons[0], icons[1]) }) } async function main() { const obs = new MutationObserver((mut, ob) => { try { for (const m of mut) { if (m.type === 'attributes') { update(m.target) } for (const n of m.addedNodes) { update(n); } } } catch (error) { } }) obs.observe(document, { childList: true, subtree: true, attributes: true }) update(document) } main(); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址