Unfortunate-Maps RES Preview Image Proxy

Fixes u-m preview images not loading in RES expandos.

目前為 2020-10-28 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name Unfortunate-Maps RES Preview Image Proxy
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description Fixes u-m preview images not loading in RES expandos.
  6. // @author Electro
  7. // @match https://www.reddit.com/r/TagPro/*
  8. // @grant none
  9. // @require https://code.jquery.com/jquery-3.4.1.min.js
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14. $(function(){
  15. console.log("loaded");
  16. setTimeout(() => {
  17. $(".expando-button").click(updateUMImages);
  18. }, 1000);
  19. });
  20.  
  21. function updateUMImages() {
  22. setTimeout(() => {
  23. let imageSRC = $(this).parent().parent().find(".res-image-media").attr("src");
  24. $(this).parent().parent().find(".res-image-media").attr("src", `https://parretlabs.xyz:8006/proxy?link=${imageSRC}&isBlob=1&type=image/png`);
  25. }, 200);
  26. }
  27. // Your code here...
  28. })();