Stackoverflow: Fix broken images

Script to replace just links (which should be images instead) with `img` tags for properly representation

目前為 2023-09-19 提交的版本,檢視 最新版本

// ==UserScript==
// @name     Stackoverflow: Fix broken images
// @description Script to replace just links (which should be images instead) with `img` tags for properly representation
// @version  0.1.0
// @namespace ClasherKasten
// @grant    none
// @license MIT
// @include https://stackoverflow.com/questions/*
// ==/UserScript==

const links = document.querySelectorAll('a[href^="https://i.stack.imgur.com/"]');
links.forEach(link => {
  const img = document.createElement('img');
  img.src = link.href;
  img.alt = link.innerText;
  link.replaceWith(img);
});

QingJ © 2025

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