I had ChatGPT write this userscript to fix older images if anyone is interested.
You will need Greasemonkey/Tampermonkey installed in your web browser to use it.
I haven't tested it extensively, but initial tests work so far. Use at own risk.
Code
// ==UserScript==
// @name Guild Wars Legacy Image Link Converter
// @description Convert image links in posts to actual images.
// @author ChatGPT
// @match https://guildwarslegacy.com/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
// Function to convert links to images
function convertImageLinks() {
// Select all message text elements
const messageTexts = document.querySelectorAll('.messageText');
messageTexts.forEach(message => {
// Find all anchor tags within the message
const links = message.querySelectorAll('a');
links.forEach(link => {
// Check if the link is an image link
if (link.href.match(/file-download\/\d+/)) {
// Create an image element
const img = document.createElement('img');
img.src = link.href; // Set the source to the link's href
img.alt = 'Image'; // Set alt text
img.style.maxWidth = '100%'; // Make sure the image is responsive
img.style.height = 'auto'; // Maintain aspect ratio
// Replace the link with the image
link.parentNode.replaceChild(img, link);
}
});
});
}
// Run the function to convert links on page load
window.addEventListener('load', convertImageLinks);
})();
Display More