Skip to content

Commit

Permalink
Standardized name to fix "simple" issue
Browse files Browse the repository at this point in the history
The setting would require a reload in order to work because the name "disable_thumbnail_playback" was different than disableHoverVideo.
Everything is now "disableThumbnailPlayback" and seems to work.
  • Loading branch information
ugackMiner53 committed Feb 11, 2024
1 parent 601137b commit 5c7543b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion _locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
"device":{"message":"Device"},
"dim":{"message":"Dim"},
"disabled":{"message":"Disabled"},
"disableHoverVideo":{"message":"Disable video playback on hover"},
"disableThumbnailPlayback":{"message":"Disable video playback on hover"},
"dislike":{"message":"Dislike"},
"displayDayOfTheWeak":{"message":"Display day of the week"},
"doNotChange":{"message":"Don't change"},
Expand Down
2 changes: 1 addition & 1 deletion js&css/extension/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ extension.events.on('init', function () {
extension.features.confirmationBeforeClosing();
extension.features.defaultContentCountry();
extension.features.popupWindowButtons();
extension.features.disableHoverVideo();
extension.features.disableThumbnailPlayback();
extension.features.markWatchedVideos();
extension.features.relatedVideos();
extension.features.comments();
Expand Down
9 changes: 4 additions & 5 deletions js&css/extension/www.youtube.com/general/general.js
Original file line number Diff line number Diff line change
Expand Up @@ -515,18 +515,17 @@ extension.features.thumbnailsQuality = function (anything) {
/*--------------------------------------------------------------
# DISABLE VIDEO PLAYBACK ON HOVER
--------------------------------------------------------------*/
extension.features.disableHoverVideo = function (event) {
extension.features.disableThumbnailPlayback = function (event) {
if (event instanceof Event) {
if (extension.storage.get('disable_thumbnail_playback') === true &&
event.composedPath().some(elem => (elem.matches != null ? elem.matches("#content ytd-rich-item-renderer") : false)
if (event.composedPath().some(elem => (elem.matches != null ? elem.matches("#content ytd-rich-item-renderer") : false)
)) {
event.stopImmediatePropagation();
}
} else {
if (extension.storage.get('disable_thumbnail_playback') === true) {
window.addEventListener('mouseenter', this.disableHoverVideo, true);
window.addEventListener('mouseenter', this.disableThumbnailPlayback, true);
} else {
window.removeEventListener('mouseenter', this.disableHoverVideo, true);
window.removeEventListener('mouseenter', this.disableThumbnailPlayback, true);
}
}
};
Expand Down
2 changes: 1 addition & 1 deletion menu/skeleton-parts/general.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ extension.skeleton.main.layers.section.general = {
},
disable_thumbnail_playback: {
component: 'switch',
text: 'disableHoverVideo',
text: 'disableThumbnailPlayback',
},
popup_window_buttons: {
component: 'switch',
Expand Down

0 comments on commit 5c7543b

Please sign in to comment.