• Nazrin@burggit.moe
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    1 year ago

    From a different thread, this one supposedly auto expands images:

    // ==UserScript==
    // @name    Expand Images
    // @match   https://burggit.moe/*
    // ==/UserScript==
    
    // Permission to use, copy, modify, and/or distribute this software for
    // any purpose with or without fee is hereby granted.
    
    // Start the script
    poll();
    
    function poll() {
      expand();
      setTimeout(poll, 200);
    }
    
    function expand() {
      const posts = document.querySelectorAll("div.post-listing");
      for (const post of posts) {
        const imgThumbnail = post.querySelector("button.thumbnail");
        const isImage = imgThumbnail !== null;
        const isExpanded = post.childElementCount > 2;
        if (isImage && !isExpanded) {
          imgThumbnail.click();
        };
      }
    }