您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
把豆瓣图片自动展开
// ==UserScript== // @name 豆瓣图片自动展开 // @version 0.1 // @description 把豆瓣图片自动展开 // @author ✌ // @license GPL 3.0 // @match https://www.douban.com/group/topic/* // @grant none // @namespace https://greasyfork.org/users/1384897 // ==/UserScript== (function() { 'use strict'; function modifyImages() { document.querySelectorAll('div.cmt-img:not(.cmt-img-large)').forEach(div => { div.classList.add('cmt-img-large'); let img = div.querySelector('img'); if (img) { img.setAttribute('raw-style', img.getAttribute('style')); img.removeAttribute('style'); } }); } modifyImages(); const observer = new MutationObserver(mutations => { mutations.forEach(mutation => { if (mutation.addedNodes.length > 0) { modifyImages(); } }); }); observer.observe(document.body, { childList: true, subtree: true }); })();