kubuzetto / behind

behind! addon source code repository
https://addons.mozilla.org/en-US/firefox/addon/behind/
Mozilla Public License 2.0
89 stars 3 forks source link

Images in blob URL not being shown #21

Closed nafarinha closed 2 years ago

nafarinha commented 2 years ago

Hi, based on a previous issue, video data in blob URLs won't be supported but what about images? In this example, Behind doesn't show any of the images (https://storymaps.arcgis.com/stories/401df732d612490e80cf111e561e05cd). Although it seems to detect a image when I right-click on one, when I then click on behind from the context menu and open the new tab, it doesn't show any image, just some metadata (e.g. svg%3EOriginal image size: 2300px to 2300px). I'm running Firefox 96.0.2 (64-bit) on Windows 10.0.19042.1466. Thank you for the extension!!

image

image

kubuzetto commented 2 years ago

Thank you for the bug report @nafarinha! I think you discovered an interesting case.

Normally, the limitation that applies to video blobs also apply to image blobs; that is, we shouldn't be able to download them via the add-on. Normally the add-on shouldn't be able to detect any viable images under the cursor; however it mistakenly captures some empty inlined <svg> image, causing the confusion (I'm getting into details to let you know that even if I fix this; the image will not be downloadable via behind!).

My initial suspicion is that the image lazily loaded; and the DOM element is dynamically replaced using javascript; so the add-on encounters the svg element but we cannot (when we inspect DOM elements manually). It appears that the page initially loads this resource; then converts it into a blob URL in-memory.

I'll be looking further into this.

nafarinha commented 2 years ago

No problem :) Glad to provide some help to crush the bug! Ty for your work with the extension!

kubuzetto commented 2 years ago

Hi @nafarinha, I'm back with some boring updates :)

I finally had a chance to properly investigate this issue. It turns out that the empty tag that behind! seemed to conjure out of thin air, in fact does appear in the page elements. The webpage does some tricks to obscure the image URLs (first loads them; then replaces the items with a canvas hidden behind a huge empty svg tag etc.), and the extension picks up on that empty svg tag. Long story short; I thought this was a bug; but it's not. If that's OK, I'm closing the issue.

nafarinha commented 2 years ago

Thanks for looking this up!