Skip to content
TheChatArchiveThe Chat Archive
Mistralmistral-medium-2505· Mistral AIHugging Face LMArena Human Preference 140K

A page I'm browsing has a bunch of images like this: <a…

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with gpt-4.1-mini-2025-04-14’s answer.
  1. User

    A page I'm browsing has a bunch of images like this: <a href="loading06.jpg">loading06.jpg</a> Please write me a Bookmarklet script that replaces all of those in the page with an image tag that displays them.

  2. Mistral Assistant

    Here's a bookmarklet that will replace all the links to images (like the one in your example) with actual <img> tags:

    javascript:(function(){
        var links = document.getElementsByTagName('a');
        for (var i = 0; i < links.length; i++) {
            var link = links[i];
            var href = link.getAttribute('href');
            if (href && (href.match(/\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i))) {
                var img = document.createElement('img');
                img.src = href;
                img.alt = link.textContent || href;
                link.parentNode.replaceChild(img, link);
            }
        }
    })();
    

    How to use this bookmarklet:

    1. Create a new bookmark in your browser
    2. Edit the bookmark and paste the entire code above as the URL (make sure to include the javascript: prefix)
    3. When you're on a page with image links like the one you described, click the bookmarklet

    What it does:

    • Finds all <a> tags on the page
    • Checks if the href attribute ends with common image file extensions
    • Replaces the link with an <img> tag that displays the image
    • Uses the link text as the alt text (or the filename if there's no link text)

    Note:

    This will only work for images that are accessible from your current domain (due to same-origin policy). If the images are on a different domain, they might not display unless the server has proper CORS headers.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.