去除公众号图片延迟加载

去除图片延迟加载,直接显示原图片

当前为 2023-02-11 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Disable Wechat Images Lazyload
  3. // @name:zh-CN 去除公众号图片延迟加载
  4. // @description Disable Wechat Images Lazyload, Show Origin Images Directly
  5. // @description:zh-CN 去除图片延迟加载,直接显示原图片
  6. // @namespace https://www.runningcheese.com
  7. // @version 0.1
  8. // @author RunningCheese
  9. // @match http://mp.weixin.qq.com/s?*
  10. // @match https://mp.weixin.qq.com/s?*
  11. // @match https://mp.weixin.qq.com/s?*
  12. // @match http://mp.weixin.qq.com/s/*
  13. // @match https://mp.weixin.qq.com/s/*
  14. // @run-at document-start
  15. // @require https://code.jquery.com/jquery-3.3.1.min.js
  16. // @icon https://t1.gstatic.cn/faviconV2?client=SOCIAL&type=FAVICON&fallback_opts=TYPE,SIZE,URL&url=https://mp.weixin.qq.com
  17. // @license MIT
  18. // ==/UserScript==
  19.  
  20.  
  21. var $ = window.jQuery;
  22.  
  23. $(document).ready(function() {
  24. setTimeout(function(){
  25. $('img').each(function(){
  26. var dataSrc = $(this).attr('data-src');
  27. if (dataSrc){
  28. $(this).attr('src', dataSrc);
  29. $(this).removeAttr('data-src');
  30. }
  31. });
  32. }, 1000);
  33. });
  34.  
  35. document.body.innerHTML = document.body.innerHTML.replace("wx_lazy=1", "")
  36. document.body.innerHTML.replace(new RegExp("data-src", "g"), "src");