Pixiv Preloads Images

Preloads images in a manga gallery

  1. // ==UserScript==
  2. // @name Pixiv Preloads Images
  3. // @namespace https://gf.qytechs.cn/es/users/47339
  4. // @description Preloads images in a manga gallery
  5. // @match *://*.pixiv.net/member_illust.php?*mode=manga*
  6. // @run-at document-end
  7. // @version 1.0.0
  8. // @grant none
  9. // @license Creative Commons Attribution 4.0 International Public License; http://creativecommons.org/licenses/by/4.0/
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14. function preloadImages(array) {
  15. if (!preloadImages.list) {
  16. preloadImages.list = [];
  17. }
  18. var list = preloadImages.list;
  19. for (var i = 0; i < array.length; i++) {
  20. var img = new Image();
  21. img.onload = function() {
  22. var index = list.indexOf(this);
  23. if (index !== -1) {
  24. list.splice(index, 1);
  25. }
  26. };
  27. list.push(img);
  28. img.src = array[i];
  29. }
  30. }
  31. preloadImages(pixiv.context.images);
  32. })();

QingJ © 2025

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