Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send raw URL to downloads API and fetch from cache #330

Open
vigilantesculpting opened this issue May 22, 2023 · 2 comments
Open

Send raw URL to downloads API and fetch from cache #330

vigilantesculpting opened this issue May 22, 2023 · 2 comments

Comments

@vigilantesculpting
Copy link

I have been running Image Picka for some time with the "Try to download image from browser cache" option turned on. This option itself is working fine. The issue is that when I now go to the images in my download history, and right-click & select "Copy Download Link", I get a URL that looks like "blob:moz-extension://..." instead of a proper original URL.

Is there a way to retrieve / convert the original download URL from these blobs? Where do I find the blobs? My google-fu is letting me down, since all I get when I google "moz extension" is a bunch of references to Firefox extensions in general...

Any help would be appreciated!

@eight04
Copy link
Owner

eight04 commented May 23, 2023

Blob URL is a URL pointing to a "blob object", which is a cached image in this case.

The download process looks like this:

  1. The extension looks into the webpage and find all images, extracts their URLs.
  2. The extension sends requests to retrieve cached data. (the cached image)
  3. The extension creates a blob URL pointing to the cached data, then send the blob URL to download manager.

Therefore, the download manager doesn't know the original URL of the image, but only the blob URL.

Is there a way to retrieve / convert the original download URL from these blobs? Where do I find the blobs?

You can't. After downloading complete, the blob is deleted to save memory.


The only way to fix this is to make download manager support downloading from cache, then we don't need the 2nd step and we can send the original URL to download manager directly.

See also: https://bugzilla.mozilla.org/show_bug.cgi?id=1698863

@vigilantesculpting
Copy link
Author

Thank you for the clarification.
I was kinda expecting as much, given that we are talking about cached images.

PS Also, thanks again for this awesome extension.

@eight04 eight04 changed the title Retrieve the URLs of images downloaded from browser cache Send raw URL to downloads API and fetch from cache Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants