Pixiv 替换为高画质原图

替换 Pixiv 的图片为高画质原图

安装此脚本
作者推荐脚本

您可能也喜欢i.pximg.net 403 Forbidden Fix

安装此脚本
  1. // ==UserScript==
  2. // @name Pixiv Replace With Original
  3. // @name:zh-TW Pixiv 替換為高畫質原圖
  4. // @name:zh-CN Pixiv 替换为高画质原图
  5. // @namespace https://blog.maple3142.net/
  6. // @version 0.4
  7. // @description Replace Pixiv image with original image
  8. // @description:zh-TW 替換 Pixiv 的圖片為高畫質原圖
  9. // @description:zh-CN 替换 Pixiv 的图片为高画质原图
  10. // @author maple3142
  11. // @match https://www.pixiv.net/member_illust.php?mode=medium&illust_id=*
  12. // @match https://www.pixiv.net/member_illust.php?illust_id=*&mode=medium
  13. // @compatible firefox >=52
  14. // @compatible chrome >=55
  15. // ==/UserScript==
  16.  
  17. ;(function() {
  18. 'use strict'
  19. const $ = s => document.querySelector(s)
  20. const $$ = s => [...document.querySelectorAll(s)]
  21. function onDomChange(cb) {
  22. new MutationObserver(() => setTimeout(cb, 50)).observe(document.body, { childList: true })
  23. }
  24. function replaceImage() {
  25. const els = $$('div[role=presentation]>a')
  26. for (const a of els) {
  27. const image = a.querySelector('img')
  28. image.src = a.href
  29. image.srcset = ''
  30. }
  31. }
  32. onDomChange(replaceImage)
  33. })()