您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Fixes the broken images of ArkhamDB's landing page.
// ==UserScript== // @name ArkhamDB Landing Page Images // @namespace http://tampermonkey.net/ // @version 1.0 // @description Fixes the broken images of ArkhamDB's landing page. // @author Chr1Z // @match https://*.arkhamdb.com/ // @icon https://i.imgur.com/T3vHgln.png // @grant none // ==/UserScript== (function () { 'use strict'; window.addEventListener('load', () => { const elements = document.querySelectorAll('[style*="background-image"]'); elements.forEach(el => { const style = el.getAttribute('style'); const match = style.match(/url\(["']?(\/[^"')]+\.png)["']?\)/); if (match) { const originalUrl = match[1]; const jpgUrl = originalUrl.replace(/\.png$/, '.jpg'); // Create a test image to see if the .png exists const img = new Image(); img.src = originalUrl; img.onerror = () => { // If .png fails to load, replace background-image with .jpg const newStyle = style.replace(originalUrl, jpgUrl); el.setAttribute('style', newStyle); }; } }); }); })();