diff --git a/src/content-script/main.css b/src/content-script/main.css index 5ae8f83..fa2b1ee 100644 --- a/src/content-script/main.css +++ b/src/content-script/main.css @@ -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_menu_buttons="true"] #menu-container, 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_channel_subscribers="true"] #owner-sub-count, html[global_enable="true"][remove_embedded_more_videos="true"] div.ytp-pause-overlay, diff --git a/src/content-script/main.js b/src/content-script/main.js index 2b8f5ab..130ce14 100644 --- a/src/content-script/main.js +++ b/src/content-script/main.js @@ -334,7 +334,8 @@ function runDynamicSettings() { const skipButtons = qsa('.ytp-ad-skip-button'). concat(qsa('.ytp-ad-skip-button-modern')). 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); if (skippableAd) { 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) { console.log(error); } diff --git a/src/shared/main.js b/src/shared/main.js index c1920b9..5483a89 100644 --- a/src/shared/main.js +++ b/src/shared/main.js @@ -281,22 +281,17 @@ const SECTIONS = [ { name: "Hide the menu buttons - Like, Share, etc.", id: "remove_menu_buttons", - defaultValue: false, - effects: { - true: { - remove_video_likes: true - } - } + defaultValue: false + }, + { + name: "Hide the clip button", + id: "remove_clip_button", + defaultValue: false }, { name: "Hide the likes", id: "remove_video_likes", - defaultValue: false, - effects: { - false: { - remove_menu_buttons: false - } - } + defaultValue: false }, { name: "Hide channel subscribers count", @@ -692,6 +687,7 @@ const idToShortId = { "remove_channel_subscribers": '80', "grayscale_mode": '81', "lock_code": '82', + "remove_clip_button": '83', };