您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
當點擊貼文圖片時,自動按讚
// ==UserScript== // @name Twitter貼文圖片自動按讚 // @name:en TweetImgAutoLike // @description 當點擊貼文圖片時,自動按讚 // @description:en When clicking on a Tweet's image, automatically like it. // @namespace https://github.com/Max46656 // @version 1.0.0 // @author Max // @match https://twitter.com/* // @match https://x.com/* // @match https://mobile.twitter.com/* // @icon https://www.google.com/s2/favicons?sz=64&domain=x.com // @license MPL2.0 // ==/UserScript== class TweetLiker { constructor() { this.observer = null; } init() { this.observer = new MutationObserver((mutations) => { mutations.forEach((mutation) => { mutation.addedNodes.forEach((node) => { if (node.nodeType === Node.ELEMENT_NODE && node.querySelector('div[aria-labelledby="modal-header"] div.r-11yh6sk[style]')) { this.clickLikeButton(node); } }); }); }); this.observer.observe(document.body, { childList: true, subtree: true }); console.log('貼文圖片觀察者啟動'); } clickLikeButton(node) { const likeButton = node.querySelector('button[data-testid="like"]'); if (likeButton) { likeButton.click(); console.log('已喜歡貼文圖片'); } else { console.warn('未找到喜歡按鈕'); } } } const johnThebardOfLove = new TweetLiker(); johnThebardOfLove.init();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址