702祖传代码

Stay Hungry Stay Smart

  1. /* jshint esversion: 6 */
  2. // ==UserScript==
  3. // @name Accelerate WeChat to doc
  4. // @name:zh-CN 702祖传代码
  5. // @description:zh-cn Stay Hungry Stay Smart
  6. // @version 0.1
  7. // @description word!word!word
  8. // @author Luka
  9. // @match *://mp.weixin.qq.com/*
  10. // @Declare Code from the network, improve the
  11. // @license GNU General Public License v3.0 or later
  12. // @namespace https://gf.qytechs.cn/users/753871
  13. // ==/UserScript==
  14.  
  15. (function() {
  16. 'use strict';
  17.  
  18. document.querySelectorAll('img').forEach(item => {
  19. let src = item.dataset.src || item.src;
  20. if (src && src.match(/wx_fmt=(\w+)/)) {
  21. item.onload = e => {
  22. if (e.target.src != src) {
  23. e.target.src = src;
  24. e.target.classList.remove('img_loading');
  25. }
  26. };
  27. item.onerror = e => console.error(e);
  28. }
  29. var img = document.getElementsByTagName('img');
  30. for (var i=0;i<img.length;i++){
  31. if(img[i].src.toLowerCase().includes('webp')){
  32. if(img[i].outerHTML.toLowerCase().includes('jpeg')){
  33. img[i].src = img[i].src.replace(/webp/g,'jpeg');}
  34. else if(img[i].outerHTML.toLowerCase().includes('jpg')){
  35. img[i].src = img[i].src.replace(/webp/g,'jpg');}
  36. else if(img[i].outerHTML.toLowerCase().includes('png')){
  37. img[i].src = img[i].src.replace(/webp/g,'png');}
  38. else if(img[i].outerHTML.toLowerCase().includes('gif')){
  39. img[i].src = img[i].src.replace(/webp/g,'gif');}
  40. else{
  41. img[i].src = img[i].src.replace(/webp/g,'jpg');}
  42. }
  43. }
  44. });
  45. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址