Skip to content

Commit

Permalink
revision
Browse files Browse the repository at this point in the history
  • Loading branch information
ImprovedTube committed Sep 12, 2023
1 parent 8e3f0fe commit fe43c30
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 21 deletions.
23 changes: 12 additions & 11 deletions js&css/extension/www.youtube.com/appearance/sidebar/sidebar.css
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,15 @@ html[data-page-type=video][it-transcript='true'][it-sidebar-left='true']:not([it
*/
html[data-page-type=video][it-transcript='true'] ytd-transcript-segment-renderer:hover { overflow-x: visible !important; }
html[data-page-type=video][it-transcript='true'] ytd-transcript-segment-renderer:has(+ ytd-transcript-segment-renderer.active) yt-formatted-string
{margin-bottom:-5px !important; margin-top:-5px !important; font-size:1.24em !important;}
{margin-bottom:-5px !important; margin-top:-5px !important; font-size:1.26em !important;}
html[data-page-type=video][it-transcript='true'] ytd-transcript-segment-renderer.active yt-formatted-string
{margin-bottom:-5px !important; margin-top:-5px !important; font-size:1.34em !important;}
{margin-bottom:-5px !important; margin-top:-5px !important; font-size:1.35em !important;}
html[data-page-type=video][it-transcript='true'] ytd-transcript-segment-renderer.active + ytd-transcript-segment-renderer yt-formatted-string
{margin-bottom:-5px !important; margin-top:-5px !important; font-size:1.25em !important;}
{margin-bottom:-5px !important; margin-top:-5px !important; font-size:1.30em !important;}
html[data-page-type=video][it-transcript='true'] ytd-transcript-segment-renderer.active + ytd-transcript-segment-renderer + ytd-transcript-segment-renderer yt-formatted-string
{margin-bottom:-5px !important; margin-top:-5px !important; font-size:1.24em !important;}

html[data-page-type=video][it-compactSpacing='true'] *[target-id*='transcript'] ytd-transcript-segment-renderer:not(.active):not(:has(+ ytd-transcript-segment-renderer.active)):not(:has(.active + ytd-transcript-segment-renderer)):not(:has(.active + ytd-transcript-segment-renderer + ytd-transcript-segment-renderer)) *
{ max-height: 15px !important; margin-bottom:-5px !important; margin-top:-5px !important; }
html[data-page-type=video][it-compactSpacing='true'] *[target-id*='transcript'] ytd-transcript-segment-renderer *
{ margin-bottom:-4px !important; margin-top:-4px !important; }
html[data-page-type=video][it-compactSpacing='true'] *[target-id*='transcript'],
html[data-page-type=video][it-compactSpacing='true'] *[target-id*='transcript'] ytd-engagement-panel-section-list-renderer #content
{ max-height: 69vh !important; margin-top:40px !important; }
Expand All @@ -97,18 +96,20 @@ html[it-related-videos='Titles'] #related #dismissible #metadata { margin-top:-3
*/

html[it-related-videos='hidden'] #related #contents,
html[it-related-videos='hidden'] #related #dismissible
html[it-related-videos='hidden'] #related #dismissible,
html[it-related-videos='hidden'] #related > ytd-watch-next-secondary-results-renderer > #items,
html[it-related-videos='hidden'] ytd-item-section-renderer,
html[it-related-videos='hidden'] ytd-compact-video-renderer
{display: none !important}

html[it-hide-tags='true'] #related #chips
html[it-related-videos='hidetabs'] #related #chips
{display: none !important}

html[it-hide-sidebar='true'] #related > ytd-watch-next-secondary-results-renderer > #items,
html[it-hide-sidebar='true'] div#secondarys div#panels,
html[it-hide-sidebar='true'] div#secondarys div#donation-shelf
html[it-hide-sidebar='true'] div#secondary div#panels,
html[it-hide-sidebar='true'] div#secondary div#donation-shelf
{display: none !important}


html[it-related-videos='collapsed'] #related > ytd-watch-next-secondary-results-renderer > #items:not([it-activated])::before {
content: 'Show more' !important;
}
Expand Down
2 changes: 1 addition & 1 deletion js&css/web-accessible/www.youtube.com/appearance.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ ImprovedTube.livechat = function () {
DETAILS
------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------
PLAYER BUTTONS
EXTRA BUTTONS BELOW THE PLAYER
------------------------------------------------------------------------------*/
ImprovedTube.improvedtubeYoutubeButtonsUnderPlayer = function () {
if (window.self !== window.top) {
Expand Down
6 changes: 3 additions & 3 deletions js&css/web-accessible/www.youtube.com/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ ImprovedTube.playerPlaybackSpeed = function () {
// Data:
let category = document.querySelector('meta[itemprop=genre]')?.content || false;
if (this.storage.player_dont_speed_education === true && category === 'Education') {return;}
if (this.storage.player_force_speed_on_music === true) {return;}
if (this.storage.player_force_speed_on_music === true) {player.setPlaybackRate(Number(option)); video.playbackRate = Number(option); return;}
let titleAndKeywords = document.getElementsByTagName('meta')?.title?.content + " " + document.getElementsByTagName('meta')?.keywords?.content || false;
let musicRegexMatch = /official (music )?video|lyrics|cover[\)\]]|[\(\[]cover|cover version|karaok|(sing|play)[- ]?along|卡拉OK|卡拉OK|الكاريوكي|караоке|カラオケ|노래방/i.test(titleAndKeywords) || false;
let notMusicRegexMatch = /do[ck]u|interv[iyj]|back[- ]?stage|インタビュー|entrevista|面试|面試|회견|wawancara|مقابلة|интервью|entretien|기록한 것|记录|記錄|ドキュメンタリ|وثائقي|документальный/i.test(titleAndKeywords) || false; // (Tags/keywords shouldnt lie & very few songs titles might have these words)
let musicRegexMatch = /official (music )?video|lyrics|cover[\)\]]|[\(\[]cover|cover version|karaok|(sing|play)[- ]?along|卡拉OK|卡拉OK|الكاريوكي|караоке|カラオケ|노래방/i.test(titleAndKeywords);
let notMusicRegexMatch = /do[ck]u|interv[iyj]|back[- ]?stage|インタビュー|entrevista|面试|面試|회견|wawancara|مقابلة|интервью|entretien|기록한 것|记录|記錄|ドキュメンタリ|وثائقي|документальный/i.test(titleAndKeywords); // (Tags/keywords shouldnt lie & very few songs titles might have these words)
let duration = document.querySelector('meta[itemprop=duration]')?.content || false; // Example: PT1H20M30S
if (duration) {
function parseDuration(duration) { const [_, h = 0, m = 0, s = 0] = duration.match(/PT(?:(\d+)?H)?(?:(\d+)?M)?(\d+)?S?/).map(part => parseInt(part) || 0);
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"short_name" : "ImprovedTube",
"name": "'Improve YouTube!' 🎧 (for YouTube & Videos)",
"description": "__MSG_description_ext__",
"version": "4.335",
"version": "4.337",
"default_locale": "en",
"icons": {
"16": "stuff/icons/16.png",
Expand Down
13 changes: 8 additions & 5 deletions menu/skeleton-parts/appearance.js
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,9 @@ extension.skeleton.main.layers.section.appearance.on.click.sidebar = {
}, {
text: "collapsed",
value: "collapsed"
}, {
text: "Hide the tabs only",
value: "hidetabs"
}],
tags: "right",
on: {
Expand Down Expand Up @@ -833,10 +836,6 @@ extension.skeleton.main.layers.section.appearance.on.click.sidebar = {
hide_shorts_remixing: {
component: "switch",
text: "Hide \'Shorts remixing this video\'"
},
hide_tags: {
component: "switch",
text: "Hide Tags"
},
livechat: {
component: "select",
Expand All @@ -859,7 +858,11 @@ extension.skeleton.main.layers.section.appearance.on.click.sidebar = {
},
hide_sidebar: {
component: "switch",
text: "Hide whole Sidebar"
text: "Hide sidebar"
},
hide_tags: {
component: "switch",
text: "Hide tags"
}
}
}
Expand Down

0 comments on commit fe43c30

Please sign in to comment.