fix blur option. use css only for disable play on hover

This commit is contained in:
Lawrence Hook
2023-06-16 11:24:55 -04:00
parent 076f734a83
commit 65f5eb5f0a
3 changed files with 32 additions and 28 deletions
+5 -1
View File
@@ -11,6 +11,8 @@ html[global_enable="true"][remove_all_shorts="true"] a[title="Shorts"],
html[global_enable="true"][remove_all_shorts="true"] *[is_short],
html[global_enable="true"][remove_all_shorts="true"] ytd-reel-shelf-renderer,
html[global_enable="true"][remove_video_thumbnails="true"] ytd-thumbnail,
html[global_enable="true"][disable_play_on_hover="true"] #video-preview,
html[global_enable="true"][disable_play_on_hover="true"] ytd-thumbnail-overlay-loading-preview-renderer[is-preview-loading],
/* Main */
html[global_enable="true"][remove_homepage="true"] ytd-browse[page-subtype="home"],
@@ -138,7 +140,9 @@ html[global_enable="true"][reverse_channel_video_list="true"] ytd-browse[page-su
/* Blur thumbnails */
html[global_enable="true"][blur_video_thumbnails="true"] ytd-thumbnail img, ytd-playlist-thumbnail img, .video-thumbnail-img {
html[global_enable="true"][blur_video_thumbnails="true"] ytd-thumbnail img,
html[global_enable="true"][blur_video_thumbnails="true"] ytd-playlist-thumbnail img,
html[global_enable="true"][blur_video_thumbnails="true"] .video-thumbnail-img {
filter: blur(20px);
}
+22 -22
View File
@@ -371,29 +371,29 @@ function runDynamicSettings() {
});
}
// Disable play on hover
if (dynamicIters % 10 === 0) {
const prefCookie = getCookie('PREF');
const prefObj = prefCookie?.split('&')?.reduce((acc, x) => {
const [ key, value ] = x.split('=');
acc[key] = value;
return acc;
}, {});
if (prefObj) {
const f7 = prefObj['f7'] || '0';
const playOnHoverEnabled = f7[f7.length-1] === '0';
// // Disable play on hover
// if (dynamicIters % 10 === 0) {
// const prefCookie = getCookie('PREF');
// const prefObj = prefCookie?.split('&')?.reduce((acc, x) => {
// const [ key, value ] = x.split('=');
// acc[key] = value;
// return acc;
// }, {});
// if (prefObj) {
// const f7 = prefObj['f7'] || '0';
// const playOnHoverEnabled = f7[f7.length-1] === '0';
if (cache['disable_play_on_hover'] && playOnHoverEnabled) {
prefObj['f7'] = f7.substring(0, f7.length-1) + '1';
const newPref = Object.entries(prefObj).map(([key, value]) => `${key}=${value}`).join('&');
setCookie('PREF', newPref);
} else if (!cache['disable_play_on_hover'] && !playOnHoverEnabled) {
prefObj['f7'] = f7.substring(0, f7.length-1) + '0';
const newPref = Object.entries(prefObj).map(([key, value]) => `${key}=${value}`).join('&');
setCookie('PREF', newPref);
}
}
}
// if (cache['disable_play_on_hover'] && playOnHoverEnabled) {
// prefObj['f7'] = f7.substring(0, f7.length-1) + '1';
// const newPref = Object.entries(prefObj).map(([key, value]) => `${key}=${value}`).join('&');
// setCookie('PREF', newPref);
// } else if (!cache['disable_play_on_hover'] && !playOnHoverEnabled) {
// prefObj['f7'] = f7.substring(0, f7.length-1) + '0';
// const newPref = Object.entries(prefObj).map(([key, value]) => `${key}=${value}`).join('&');
// setCookie('PREF', newPref);
// }
// }
// }
// Show description
if (cache['expand_description'] || cache['remove_comments']) {
+5 -5
View File
@@ -27,6 +27,11 @@ const SECTIONS = [
id: "blur_video_thumbnails",
defaultValue: false,
},
{
name: "Disable play on hover",
id: "disable_play_on_hover",
defaultValue: false
},
{
name: "Enable search engine mode",
id: "search_engine_mode",
@@ -89,11 +94,6 @@ const SECTIONS = [
id: "remove_infinite_scroll",
defaultValue: false
},
{
name: "Disable play on hover (page reload required)",
id: "disable_play_on_hover",
defaultValue: false
},
]
},
{