Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Fix #7667: Fix Long-press not detecting video elements of zero size #7679

Merged
merged 1 commit into from
Jul 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,19 @@ window.__firefox__.includeOnce("Playlist", function($) {
}
}

// No elements found nearby
// Select the first of each IF found because some websites can have video elements with zero size.
// In such cases, the gesture would not be on or inside the element, so this is a fallback.
if (!targetVideo && !targetAudio) {
if (videoElements.length > 0) {
targetVideo = videoElements[0];
}

if (audioElements.length > 0) {
targetAudio = audioElements[0];
}
}

// No elements found nearby so do nothing..
if (!targetVideo && !targetAudio) {
return;
Expand Down