Behance - fetch lazy-load images immediately

Fetch lazy-load images immediately at document load

目前为 2014-10-16 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Behance - fetch lazy-load images immediately
  3. // @description Fetch lazy-load images immediately at document load
  4. // @version 1.0
  5. // @namespace http://wOxxOm.scripts
  6. // @author wOxxOm
  7. // @include https://www.behance.net/*
  8. // @run-at document-start
  9. // ==/UserScript==
  10.  
  11. window.addEventListener('DOMContentLoaded', function(e) {
  12. for (img of document.body.getElementsByTagName('img'))
  13. if (img.className.indexOf('lazy')>=0) {
  14. img.src = (s = img.getAttribute('data-hd-src')) ? s : img.getAttribute('original');
  15. img.className = img.className.replace(/\S*?lazy\S*/, '');
  16. }
  17. });