* AutoPagerize Lazy Load Assistant

修复某些 AutoPagerize 脚本、扩展和附加组件中出现的延迟加载图像问题。

目前为 2020-11-24 提交的版本。查看 最新版本

// ==UserScript==
// @name        * AutoPagerize Lazy Load Assistant
// @name:ja     * AutoPagerize Lazy Load Assistant
// @name:zh-CN  * AutoPagerize Lazy Load Assistant
// @namespace   knoa.jp
// @description It fixes the lazyload image problem on some AutoPagerize scripts, extensions or add-ons.
// @description:ja 一部の AutoPagerize スクリプト、拡張機能、アドオンで発生する、遅延読み込み画像の問題を修正します。
// @description:zh-CN 修复某些 AutoPagerize 脚本、扩展和附加组件中出现的延迟加载图像问题。
// @include     *
// @version     1
// @grant       none
// ==/UserScript==

(function() {
  const SCRIPTNAME = 'AutoPagerize Lazy Load Assistant';
  const DATASETS = [
    'src',
    'lazySrc',
    'original',
  ];
  let name = undefined; //そのページで使われているlazyloadプロパティ名は一度確定したら変わらない
  document.addEventListener('GM_AutoPagerizeNextPageLoaded', e => {
    console.log(SCRIPTNAME, e.type);
    const d = e.target;
    const imgs = d.querySelectorAll('img');
    imgs.forEach(img => {
      if(name === undefined){
        name = DATASETS.find(n => img.dataset[n]);
        if(name === undefined) return;
      }
      if(img.dataset[name] !== undefined){
        img.src = img.dataset[name];
      }
    });
  });
})();

QingJ © 2025

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