Skip to content

Commit

Permalink
Merge branch 'code-charity:master' into feature-1
Browse files Browse the repository at this point in the history
  • Loading branch information
MAZ01001 authored Oct 31, 2023
2 parents 15ffa03 + 626616c commit 43d0cd3
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 19 deletions.
21 changes: 12 additions & 9 deletions js&css/extension/www.youtube.com/appearance/player/player.css
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ html[data-page-type=video][it-player-size='full_window'] .ytp-fit-cover-video .h

/*outdated line?*/ html[data-page-type=video][it-player-size='full_window'] ytd-watch-flexy[theater]:not([fullscreen]) #player-wide-container,
html[data-page-type=video][it-player-size='full_window'] ytd-watch-flexy[full-bleed-player]:not([fullscreen]) #full-bleed-container.ytd-watch-flexy {
height: calc(var(--it-player-size, 100vh) - var(--it-header-size)) !important;
height: calc(var(--it-player-size, 100vh) - var(--it-header-size, 0)) !important;
max-height: var(--it-player-size, 100vh) !important;
}

Expand All @@ -430,13 +430,13 @@ html[data-page-type=video][it-player-size='fit_to_window'] .ytp-fit-cover-video
--------------------------------------------------------------*/

html[data-page-type='video'][it-player-size]:not([it-player-size='do_not_change']):not([it-player-size='custom']):not([it-player-size='normal']):not([it-player-size='fit_to_window']) ytd-app:not([player-fullscreen_]) ytd-watch-flexy:not([fullscreen]) #player-container-inner {
padding-top: calc(var(--it-player-size) - var(--it-header-size)) !important;
padding-top: calc(var(--it-player-size, 100vh) - var(--it-header-size, 0)) !important;
}

html[data-page-type='video'][it-player-size]:not([it-player-size='do_not_change']):not([it-player-size='custom']):not([it-player-size='normal']):not([it-player-size='fit_to_window']) ytd-app:not([player-fullscreen_]) ytd-watch-flexy:not([theater]):not([fullscreen]) #player-container,
html[data-page-type='video'][it-player-size]:not([it-player-size='do_not_change']):not([it-player-size='custom']):not([it-player-size='normal']):not([it-player-size='fit_to_window']) ytd-app:not([player-fullscreen_]) ytd-watch-flexy[theater]:not([fullscreen]) #player-theater-container {
width: auto !important;
height: calc(var(--it-player-size) - var(--it-header-size)) !important;
height: calc(var(--it-player-size, 100vh) - var(--it-header-size, 0)) !important;
min-height: auto !important;
max-height: none !important;
}
Expand All @@ -460,7 +460,7 @@ html[data-page-type='video'][it-player-size]:not([it-player-size='do_not_change'
left: 0 !important;
width: auto !important;
max-width: 100% !important;
height: calc(var(--it-player-size) - var(--it-header-size)) !important;
height: calc(var(--it-player-size, 100vh) - var(--it-header-size, 0)) !important;
}


Expand Down Expand Up @@ -494,10 +494,13 @@ html[data-page-type='video'][it-player-size]:not([it-player-size='do_not_change'

[data-page-type='video'][it-player-size='fit_to_window'] ytd-app:not([player-fullscreen_]) ytd-watch-flexy[theater]:not([fullscreen]) video {
position: static !important;
/* width: auto !important;
height: calc(var(--it-player-size, 100vh) - var(--it-header-size, 0)) !important;
*/
max-height: none !important;
max-width: 100% !important;
height: var(--height) !important;
width: var(--width) !important;
height: var(--height, 64vh) !important;
width: var(--width, 36vw) !important;

}

Expand Down Expand Up @@ -529,7 +532,7 @@ html[data-page-type='video'][it-player-size]:not([it-player-size='do_not_change'
[data-page-type='video'][it-player-size='fit_to_window'] ytd-app:not([player-fullscreen_]) ytd-watch-flexy:not([theater]):not([fullscreen]) video {
position: static !important;
width: 100% !important;
height: calc(var(--it-player-size) - var(--it-header-size)) !important;
height: calc(var(--it-player-size, 100vh) - var(--it-header-size, 0)) !important;
max-height: none !important;
}

Expand All @@ -539,8 +542,8 @@ html[data-page-type='video'][it-player-size]:not([it-player-size='do_not_change'

html[data-page-type='video'][it-player-size='custom'] ytd-app:not([player-fullscreen_]) ytd-watch-flexy:not([theater]):not([fullscreen]) #player-container,
html[data-page-type='video'][it-player-size='custom'] ytd-app:not([player-fullscreen_]) ytd-watch-flexy[theater]:not([fullscreen]) #player-theater-container {
width: var(--it-player-width) !important;
height: var(--it-player-height) !important;
width: var(--it-player-width, 64vw) !important;
height: var(--it-player-height, 36vh) !important;
margin: 0 auto;
min-height: auto !important;
max-height: none !important;
Expand Down
8 changes: 5 additions & 3 deletions js&css/extension/www.youtube.com/general/general.js
Original file line number Diff line number Diff line change
Expand Up @@ -558,17 +558,18 @@ extension.features.thumbnailsQuality = function (anything) {
--------------------------------------------------------------*/

extension.features.openNewTab = function (){
if (extension.storage.get("open_new_tab") === true) {
window.onload = function () {
const searchButton = document.querySelector("button#search-icon-legacy");
const inputField = document.querySelector("input#search");

searchButton.addEventListener("click", (event) => {
if (extension.storage.get("open_new_tab") === true) {

performSearchNewTab(event);
}

});
inputField.addEventListener("keydown", function (event) {
if (extension.storage.get("open_new_tab") === true && event.key === "Enter") {
if (event.key === "Enter") {
performSearchNewTab(event);
}
});
Expand All @@ -585,4 +586,5 @@ extension.features.openNewTab = function (){
inputField.focus();
}
}
}
}
8 changes: 4 additions & 4 deletions js&css/extension/www.youtube.com/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -181,18 +181,18 @@ html[it-mini-player-cursor='nw-resize']::after {
/*------------------------------------------------------------------------------
#
------------------------------------------------------------------------------*/
.ytp-right-controls{
html[data-page-type='video'][it-player-fit-to-win-button='true'] .ytp-right-controls{
display: flex;
}

#it-fit-to-win-player-button{
html[data-page-type='video'][it-player-fit-to-win-button='true'] #it-fit-to-win-player-button{
order: 1;
}
.ytp-fullscreen-button{
html[data-page-type='video'][it-player-fit-to-win-button='true'] .ytp-fullscreen-button{
order: 2;
}

#ftw-icon path {
html[data-page-type='video'][it-player-fit-to-win-button='true'] #ftw-icon path {
fill: none;
}
.it-player-button {
Expand Down
4 changes: 2 additions & 2 deletions js&css/web-accessible/www.youtube.com/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ ImprovedTube.playerPlaybackSpeed = function () {
let keywords = document.getElementsByTagName('meta')?.keywords?.content || false;
var musicIdentifiers = new RegExp("(official|music|lyrics)[ -]video|(cover|studio|radio|album|alternate)[- ]version|theme song|soundtrack|unplugged|\bmedley\b|\blo-fi\b|\blofi\b|a(lla)? cappella|feat\.|(piano|guitar|jazz|ukulele|violin|reggae)[- ](version|cover)|karaok|backing[- ]track|instrumental|(sing|play)[- ]?along|卡拉OK|卡拉OK|الكاريوكي|караоке|カラオケ|노래방|bootleg|mashup|Radio edit|Guest (vocals|musician)|(title|opening|closing|bonus|hidden)[ -]track|live acoustic|interlude|featuring|recorded (at|live)" , "i");
var musicRegexMatch = musicIdentifiers.test(title);
if (!musicRegexMatch) { musicRegexMatch = /lyrics|\bremix|\bfull song\b|\bsong:|\bsong[\!$]|^song\b|( - .*\bSong\b|\bSong\b.* - )|cover[\)\]]|[\(\[]cover|\bconcert\b/i.test(title);
if (!musicRegexMatch) { musicRegexMatch = /lyrics|\bremix|\bAMV ?[^a-z0-9]|[^a-z0-9] ?AMV\b|\bfull song\b|\bsong:|\bsong[\!$]|^song\b|( - .*\bSong\b|\bSong\b.* - )|cover ?[^a-z0-9]|[^a-z0-9] ?cover|\bconcert\b/i.test(title);
if (!musicRegexMatch) { musicRegexMatch = musicIdentifiers.test(keywords);
if (!musicRegexMatch) { musicRegexMatch = /, (lyrics|remix|song|music),|\bfull song\b/i.test(keywords);
if (!musicRegexMatch) { musicRegexMatch = /, (lyrics|remix|song|music|AMV),|\bfull song\b/i.test(keywords);
}
}
}
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.400",
"version": "4.401",
"default_locale": "en",
"icons": {
"16": "stuff/icons/16.png",
Expand Down

0 comments on commit 43d0cd3

Please sign in to comment.