Lemmy Image Expand

Auto expands all image posts except NSFW ones.

< 腳本Lemmy Image Expand的回應

評論:正評 - 腳本一切正常

§
發表於:2023-11-11
編輯:2023-11-11

Works exactly as intended.

If you want it to open NSFW posts as well, change this code:

      uniqueList.forEach(function(imgPreview) {
        const postListing = imgPreview.closest(".post-listing");
        const isExpanded = postListing.querySelector('.img-expanded') != null;
        const isNsfw = postListing.querySelector('.thumbnail.img-blur') != null;
        if(!isExpanded && !isNsfw) {
          imgPreview.click();
        }

To this:

      uniqueList.forEach(function(imgPreview) {
        const postListing = imgPreview.closest(".post-listing");
        const isExpanded = postListing.querySelector('.img-expanded') != null;
        if(!isExpanded) {
          imgPreview.click();
        }

發表回覆

登入以回覆