Wallhaven图片加载不出来

2022-06-30  本文已影响0人  还是一打

1、浏览器安装油猴(Tampermonkey )扩展

2、启动油猴,点击  “添加新脚本”  

3、复制粘贴以下代码并保存

添加代码

// ==UserScript==

// @name wallhaven

// @namespace https://wallhaven.cc/

// @version 0.1

// @Description try to take over the world!

// @Author zerwa

// @include https://wallhaven.cc/*

// @iconURL https://wallhaven.cc/favicon.ico

// @run-at document-start

// @require https://cdn.bootcdn.net/ajax/libs/jquery/3.3.1/jquery.min.js

// @grant none

// ==/UserScript==

(

function() {

'use strict';

}

)();

4、如果还是不行,改成下面的代码

// ==UserScript==

// @name        wallhaven缩略图加载

// @namespace    http://tampermonkey.net/

// @version      0.1

// @description  解决wallhaven缩略图无法加载问题

// @author      You

// @match        https://wallhaven.cc/*

// @icon        https://wallhaven.cc/images/layout/logo_sm.png

// @grant        none

// ==/UserScript==

(function() {

    'use strict';

    // Your code here...

    var list = document.getElementsByClassName('lazyload')

for(var i = 0; i<list.length; i++) {

list[i].src= list[i].getAttribute('data-src')

list[i].style.opacity = 1

}

})();

上一篇下一篇

猜你喜欢

热点阅读