Skip to content
TheChatArchiveThe Chat Archive
gpt-4.1-mini-2025-04-14· OpenAIHugging 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 Mistralmistral-medium-2505’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. Assistant

    Sure! Here's a bookmarklet that will find all <a> elements whose href ends with .jpg (you can easily extend it to other image types if you want) and replace their content with an <img> tag displaying the image:

    javascript:(function(){
      var links = document.querySelectorAll('a[href$=".jpg"]');
      links.forEach(function(link){
        var img = document.createElement('img');
        img.src = link.href;
        img.alt = link.textContent || 'image';
        img.style.maxWidth = '200px';  // optional: limit image size
        img.style.maxHeight = '200px';
        link.textContent = '';  // clear the link text
        link.appendChild(img);
      });
    })();
    

    How to use:

    1. Copy the entire code above.
    2. Create a new bookmark in your browser.
    3. Paste the code into the URL/location field of the bookmark.
    4. Save it.
    5. When you are on the page with those links, click the bookmarklet.
    6. All .jpg links will be replaced with the actual images.

    If you want to support more image types (like .png, .gif), just let me know!

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