您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
try to take over the world!
// ==UserScript== // @name pinterest - switch to gif // @namespace http://tampermonkey.net/ // @version 1.4 // @description try to take over the world! // @author emattias // @match https://www.pinterest.se/* // @grant none // ==/UserScript== function processGifNode(node) { const img = node.nextSibling.querySelector('img') const src = img.getAttribute('src') if (src) { const newSrc = src.replace(/(.+)\/\d{1,3}x\/(.+)\.jpg/gi, '/originals/gif') img.setAttribute('src', newSrc) if (node.classList.contains('playIndicatorPill')) { node.remove() } } } var observer = new MutationObserver(function(mutations) { mutations.forEach(function(mutation) { if (mutation.addedNodes.length > 0) { mutation.addedNodes .forEach((node) => { const gifNodes = node.querySelectorAll('.gifType') if (gifNodes.length > 0) { gifNodes .forEach(processGifNode) } }) } }); }); // pass in the target node, as well as the observer options observer.observe(document.querySelector('.appContent'), { childList: true, subtree: true });