Skip to content

Commit

Permalink
playerHdThumbnail
Browse files Browse the repository at this point in the history
  • Loading branch information
raszpl authored Aug 4, 2024
1 parent 1c10e6f commit 2d58780
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions js&css/web-accessible/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,10 @@ ImprovedTube.ytElementsHandler = function (node) {
ImprovedTube.elements.video = node.querySelector('video');
ImprovedTube.elements.player_left_controls = node.querySelector('.ytp-left-controls');
ImprovedTube.elements.player_right_controls = node.querySelector('.ytp-right-controls');
ImprovedTube.elements.player_thumbnail = node.querySelector('.ytp-cued-thumbnail-overlay-image');
ImprovedTube.elements.player_subtitles_button = node.querySelector('.ytp-subtitles-button');
ImprovedTube.playerSize();
ImprovedTube.playerHdThumbnail(node.querySelector('.ytp-cued-thumbnail-overlay-image'));

if (typeof ImprovedTube.storage.ads !== 'undefined' && ImprovedTube.storage.ads !== "all_videos") {
new MutationObserver(function (mutationList) {
for (var i = 0, l = mutationList.length; i < l; i++) {
Expand All @@ -216,23 +217,6 @@ ImprovedTube.ytElementsHandler = function (node) {
subtree: true
});
}

new MutationObserver(function (mutationList) {
for (var i = 0, l = mutationList.length; i < l; i++) {
var mutation = mutationList[i];

if (mutation.type === 'attributes') {
if (mutation.attributeName === 'style') {
ImprovedTube.playerHdThumbnail();
}
}
}
}).observe(ImprovedTube.elements.player_thumbnail, {
attributes: true,
attributeFilter: ['style'],
childList: false,
subtree: false
});
break

// FIXME
Expand Down

0 comments on commit 2d58780

Please sign in to comment.