Add an option to remove the clip button

This commit is contained in:
Lawrence Hook
2024-12-14 11:08:16 -05:00
parent 615cfad300
commit bb5f4331ef
3 changed files with 17 additions and 13 deletions
+1
View File
@@ -71,6 +71,7 @@ html[global_enable="true"][remove_info_cards="true"] .ytp-ce-element.ytp-ce-elem
html[global_enable="true"][remove_vid_description="true"] ytd-watch-metadata #description, html[global_enable="true"][remove_vid_description="true"] ytd-watch-metadata #description,
html[global_enable="true"][remove_menu_buttons="true"] #menu-container, html[global_enable="true"][remove_menu_buttons="true"] #menu-container,
html[global_enable="true"][remove_menu_buttons="true"] #actions, html[global_enable="true"][remove_menu_buttons="true"] #actions,
html[global_enable="true"][remove_clip_button="true"] #menu button[scissor_button],
html[global_enable="true"][remove_video_likes="true"] like-button-view-model .yt-spec-button-shape-next__button-text-content, html[global_enable="true"][remove_video_likes="true"] like-button-view-model .yt-spec-button-shape-next__button-text-content,
html[global_enable="true"][remove_channel_subscribers="true"] #owner-sub-count, html[global_enable="true"][remove_channel_subscribers="true"] #owner-sub-count,
html[global_enable="true"][remove_embedded_more_videos="true"] div.ytp-pause-overlay, html[global_enable="true"][remove_embedded_more_videos="true"] div.ytp-pause-overlay,
+8 -1
View File
@@ -334,7 +334,8 @@ function runDynamicSettings() {
const skipButtons = qsa('.ytp-ad-skip-button'). const skipButtons = qsa('.ytp-ad-skip-button').
concat(qsa('.ytp-ad-skip-button-modern')). concat(qsa('.ytp-ad-skip-button-modern')).
concat(qsa('.ytp-skip-ad-button')). concat(qsa('.ytp-skip-ad-button')).
concat(qsa('#skip-button:2')); concat(qsa(CSS.escape("button#skip-button:2")));
const skippableAd = skipButtons?.some(button => button.offsetParent); const skippableAd = skipButtons?.some(button => button.offsetParent);
if (skippableAd) { if (skippableAd) {
skipButtons?.forEach(e => { skipButtons?.forEach(e => {
@@ -532,6 +533,12 @@ function runDynamicSettings() {
} }
} }
// Video Player: hide the 'clip' button.
// The path[d=...] selector selects scissor SVGs.
qsa('path[d^="M8 7c0 .55-.45 1-1 1s-1-.45-1-1"]').
map(path => path.closest('#menu button')).
forEach(b => b.setAttribute('scissor_button', ''));
} catch (error) { } catch (error) {
console.log(error); console.log(error);
} }
+8 -12
View File
@@ -281,22 +281,17 @@ const SECTIONS = [
{ {
name: "Hide the menu buttons - Like, Share, etc.", name: "Hide the menu buttons - Like, Share, etc.",
id: "remove_menu_buttons", id: "remove_menu_buttons",
defaultValue: false, defaultValue: false
effects: { },
true: { {
remove_video_likes: true name: "Hide the clip button",
} id: "remove_clip_button",
} defaultValue: false
}, },
{ {
name: "Hide the likes", name: "Hide the likes",
id: "remove_video_likes", id: "remove_video_likes",
defaultValue: false, defaultValue: false
effects: {
false: {
remove_menu_buttons: false
}
}
}, },
{ {
name: "Hide channel subscribers count", name: "Hide channel subscribers count",
@@ -692,6 +687,7 @@ const idToShortId = {
"remove_channel_subscribers": '80', "remove_channel_subscribers": '80',
"grayscale_mode": '81', "grayscale_mode": '81',
"lock_code": '82', "lock_code": '82',
"remove_clip_button": '83',
}; };