eight04 / image-picka

A Firefox/Chrome extension helping you download images.
MIT License
171 stars 19 forks source link

Addon fails to handle missing srcset #344

Closed Volbla closed 1 week ago

Volbla commented 8 months ago

Image picka used to work on fantia.jp. One day it suddenly stopped working and just showed a popup message: "a is undefined", but it only happens on some pages. I think the problem is when a source-tag doesn't have a srcset property.

Steps to reproduce the behavior:

  1. Go to fantia.jp Content Warning: Contains adult content, although it is mostly censored if you're not logged in.
  2. On the main page and users search pages the addon works fine. (searching requries login)
  3. On the posts search page, user frontpages /fanclubs/1234, user galleries /fanclubs/1234/posts and individual posts /posts/1234 i get the error popup and the picker window never opens.

I decided to poke around in the debugger and it seems like the issue is elements missing the expected properties. The first i noticed was srcset, which apparently can happen if the image hasn't loaded in yet or if it's a censored low-res thumbnail, html examples. If it's the former, the addon starts working again if i first scroll down to load the missing images.

There might also be an issue with trying to get the .alt of a picture element.

eight04 commented 1 month ago

Do you use Chrome? Might be fixed in #351