Pixiv Medium Page Replace With Original

Replace Pixiv medium page's image with original image

当前为 2018-06-24 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Pixiv Medium Page Replace With Original
  3. // @namespace https://blog.maple3142.net/
  4. // @version 0.1
  5. // @description Replace Pixiv medium page's image with original image
  6. // @author maple3142
  7. // @match https://www.pixiv.net/member_illust.php?mode=medium&illust_id=*
  8. // @run-at document-start
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict'
  14.  
  15. const PREFIX=Math.random().toString(36)
  16. Object.defineProperty(Object.prototype,'props',{
  17. set(v){
  18. this[PREFIX+'_props']=v
  19. if(v.urls)onTarget(this)
  20. },
  21. get(v){
  22. return this[PREFIX+'_props']
  23. }
  24. })
  25. const keys=['mini','regular','regular','thumb']
  26. function onTarget(target){
  27. const url=target.props.urls.original
  28. target.props.urls=new Proxy({},{
  29. get: ()=>url
  30. })
  31. }
  32. })()