// ==UserScript== // @name Pixiv Origin Image // @name:zh-cn Pixiv 原图显示 // @namespace http://tampermonkey.net/ // @version 0.2 // @description Pixiv原图显示 // @author Faper // @license MIT // @match http*://www.pixiv.net/* // @connect i.pximg.net // @connect i-f.pximg.net // @connect i-cf.pximg.net // @icon http://www.pixiv.net/favicon.ico // @grant none // @run-at document-end // @downloadURL none // ==/UserScript== (function() { const callback = () => { const imgTags = document.querySelectorAll("a img"); for(let imgTag of imgTags) { const originImg = imgTag.parentElement.href; if(/https:\/\/i.pximg.net\/img-original\/img\/[\w|\/]+\.(?:jpg|png)/g.test(originImg)) { imgTag.setAttribute("src", originImg); } } } const targetNode = document.querySelector("body"); const config = { childList: true, subtree: true, } const observer = new MutationObserver(callback); observer.observe(targetNode, config); })();