Skip to content

Commit

Permalink
v1.2.1: Fixed single image downloads in gallery-carousel
Browse files Browse the repository at this point in the history
  • Loading branch information
956MB committed Sep 27, 2024
1 parent 41a5876 commit ee691bb
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,27 @@

All notable changes to the Reddit Image Downloader extension will be documented in this file.

## 1.2.1 - 2024-09-27

### Fixed

- Fixed issue where single image downloads from inside gallery carousel would not work. Reddit seems to have remove the `tabindex` attribute from the li elements in the gallery carousel, which was used to identify the selected image. We now check if the li has style `visibility: visible` to get the correct indexed image.

## 1.2 - 2024-09-10

### Added

- Added support for downloading single images from within the Reddit gallery carousel ("lightbox", when you click on a image and the gallery expands to fill the page).

## [1.1] - 2024-08-18
## 1.1 - 2024-08-18

### Fixed

- Fixed posts containing video player or embedded video links incorrectly being given a download button.
- Also fixed GIF posts not being detected as a single image and download not working.
- Resolved issue where only 10 images could be downloaded from posts containing more than 10 images. Implemented batch processing with a short delay between batches to comply with Reddit's rate limiting while allowing download of all images in a post.

## [1.0] - 2024-07-25
## 1.0 - 2024-07-25

### Added

Expand Down
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,11 @@ The browser extension that I've always wanted for Reddit... a download button fo

## Changelog

#### 1.2 - 2024-09-10
[1.2.1](./CHANGELOG.md#121---2024-09-27) - 2024-09-27

##### Added
##### Fixed

- Added support for downloading single images from within the Reddit gallery carousel ("lightbox", when you click on a image and the gallery expands to fill the page).

[1.1](./CHANGELOG.md#11---2024-08-18) - 2024-08-18

[1.0](./CHANGELOG.md#10---2024-07-25) - 2024-07-25
- Fixed issue where single image downloads from inside gallery carousel would not work. Reddit seems to have remove the `tabindex` attribute from the li elements in the gallery carousel, which was used to identify the selected image. We now check if the li has style `visibility: visible` to get the correct indexed image.

For a full list of changes and past versions, please see the [CHANGELOG.md](CHANGELOG.md)

Expand Down
4 changes: 2 additions & 2 deletions content.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==
// @name Reddit Image Download Button
// @description Adds a button to download images from Reddit posts
// @version 1.2
// @version 1.2.1
// @author Alexander Bays (956MB)
// @namespace https://github.com/956MB/reddit-download-button
// @match https://*.reddit.com/*
Expand Down Expand Up @@ -200,7 +200,7 @@
await loadAllImages(gallery);
if (isLightbox) {
gallery.querySelectorAll("li").forEach((li, index) => {
if (li.getAttribute('tabindex') === "0") {
if (li.style.visibility === "visible" || li.getAttribute('tabindex') === "0") {
const img = li.querySelector("img.media-lightbox-img");
if (img) {
urls.push(getHighestResUrl(img));
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "Reddit Download Button",
"version": "1.2",
"version": "1.2.1",
"description": "Adds a button to download images from Reddit posts",
"permissions": [
"activeTab",
Expand Down

0 comments on commit ee691bb

Please sign in to comment.