kubuzetto / behind

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

YouTube videos thumbnail support #20

Closed aha999 closed 3 years ago

aha999 commented 3 years ago

Hi. i use your addon and one of the main features that i would like to see is that i could see which thumbnail is behind a youtube video. Currently if i press Shift + right click on a video to bring up a context menu, Behind function is not there like it usually is.

Please add support for YouTube video thumbnails download/Behind feature

kubuzetto commented 3 years ago

Hi @aha999, thanks for the bug report!

Can you please try to right-click on the images without shift? Seems to work that way for me.

aha999 commented 3 years ago

Only right clicking opens youtube context menu, not firefox context menu

kubuzetto commented 3 years ago

Hi again @aha999, I wrote an answer first; then realized that what I'm saying is not correct.

YouTube removes the thumbnail image element from DOM after the video starts playing. If I open the YouTube link in a different tab for example (so that YT does not auto-play), the thumbnail image element will be there and behind! works properly with Shift + right-click.

Can you please verify this?

aha999 commented 3 years ago

Yes this works, but in the page sources (when playing) the full resolution of the thumbnail is still accessible if you look through html. So it would be nice if Behind accessed that nontheless

kubuzetto commented 3 years ago

The DOM element containing the thumbnail is indeed in the HTML if you inspect elements, but it is hidden by display: none. The browser does not calculate the position and dimensions for elements hidden like this; therefore the getBoundingClientRect function returns no useful information. There is simply no way of saying that the image is under the cursor, because it is not.

If the position of the image is not important, you can use the native View Page Info feature in Firefox through the top menu by Tools > Page Info. Or you can use the shortcut Ctrl+I in Windows/Linux (⌘+I in Mac).

I hope this helps!