您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
点击方法实现贴吧图片、回复自动展开
// ==UserScript== // @name 贴吧图片、评论自动展开 // @namespace http://tampermonkey.net/ // @version 1.1 // @license MIT // @description 点击方法实现贴吧图片、回复自动展开 // @author NoWorld // @match *://tieba.baidu.com/p/* // @grant none // @icon https://tb3.bdstatic.com/public/icon/favicon-v2.ico // ==/UserScript== (function() { 'use strict'; // 点击实现 function clickElements(selector) { const elements = document.querySelectorAll(selector); elements.forEach((element) => { if (element) { element.click(); } }); } // 点击按钮 const observer = new MutationObserver((mutations) => { mutations.forEach((mutation) => { if (mutation.addedNodes.length) { clickElements('div.replace_tip'); clickElements('a.j_lzl_m'); } }); }); // 加载内容 observer.observe(document.body, { childList: true, subtree: true }); })();