Skip to content

Commit

Permalink
Merge branch 'master' into feature-2
Browse files Browse the repository at this point in the history
  • Loading branch information
MAZ01001 committed Nov 15, 2023
2 parents 449fbdc + cd02721 commit 6c63fcd
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 39 deletions.
32 changes: 14 additions & 18 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,27 @@ assignees: ''
## Bug Report:
**BUG**: <!-- (a clear/concise description) -->
**HOW**: <!-- Steps to **reproduce** the Bug. ( Might require your specific combination of browser, versions, extensions, settings ) -->
⚬ ImprovedTube Version: <!-- [e.g. 4.28 You can find it at the ⋮ icon>settings>version] -->
⚬ If a YouTube change started the bug, please copy the DOM you get (especially if the bug doesn't happen when you log out or on another computer)
⚬ Or did our last update start the bug?
⚬ ImprovedTube Version: __ <!-- [ written at the top, in the stores & under our ⋮ icon>settings>version] -->

---

<!-- ( please Click:"PREVIEW" , to understand this template ) -->

_**1.** Thanks for coming & caring! Before submitting, please check if the issue has already been reported ever. With [GitHub's issue search (use this link)](https://github.com/ImprovedTube/ImprovedTube/issues?q=) (else removing "is:issue is:open" from the standard search)_ -->
<!-- ( You can click:"PREVIEW" to understand this template ) -->
**1.** Thanks for coming & caring! Before submitting, please check if the issue has already been reported ever. With [GitHub's issue search (use this link)](https://github.com/ImprovedTube/ImprovedTube/issues?q=) _(else removing "is:issue is:open" from the standard search) ( - If it was posted before, you can answer/react there to give it your voice and move it up in the lists) ( - If the status is "closed" (=fixed) recently, then Web Stores can be updated soon - if it was closed month or years ago, then it might reappeared & must be fixed again.)_

_**2.** If you find the issue you can answer/react there to give it your voice (or just say hello :) ),_
- _If the status is "closed" (=fixed) recently, then Web Stores might also be updated soon - if
it was closed month or years ago, then it reappeared and must be fixed again._

**3. To find the bug: Can you ...?:**
- ...log out? (maybe YouTube is testing a new version while you are logged in)
- ...deactivate all other extensions running on YouTube? (or use an incognito window after activating this extension to run there / _chrome://extensions `details` chrome://extensions/?id=bnomihfieiccainjcjblhegjgglakjdd_ )
- ...open the Browser-console, with the F12-Key, before/when the error occures? (then hopefully you'll see an error message in the console).
- ..._copy&paste (or screenshot) the YouTube-DOM shown above the console, just in case YouTube is giving you another version._
**2. To give us a chance to solve the bug: Can you ...?:**
- ..deactivate other extensions running on YouTube? (or use an incognito window after activating this extension to run there / _chrome://extensions `details` chrome://extensions/?id=bnomihfieiccainjcjblhegjgglakjdd_ )
- ..open the Browser-console, with the `F12`-Key, before/when the error occures? (then hopefully you'll see an error message in the console).
- ...copy the YouTube-DOM shown above the console (`F12`) in case YouTube is giving you a new verson. You can copying the root element `<html>` in the top after the bug happened:
![chrome](https://github.com/code-charity/youtube/assets/25022245/ab976601-516a-40ad-970a-a5dbfc490c06)
![Firefox](https://github.com/code-charity/youtube/assets/25022245/d5c2cd43-b77c-4c65-b9ba-cb6e85a18d9c)
- There are 2-3 different versions depending if you open a new window or clicked a link on youtube

---
More / optionally:

*Screenshots*: <!-- (maybe) -->
/ ⚬ *Context*: <!-- (Additional context maybe) -->
/ ⚬ *EXPECTED (/preferred) behavior*:

### Setup:
/ ⚬ *Expected /preferred behavior*:
⚬ Browser: <!-- [e.g. Chromium 83.0.4103.116 / Firefox / Safari / ...] -->
⚬ Settings: <!-- MAYBE Attach your settings `(ImprovedTube -> Settings -> Backup & reset -> Export settings. Can delete the video lists in it if any)` -->
<!-- & MAYBE fill in more**details**: -->
Expand Down
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
12 changes: 8 additions & 4 deletions js&css/web-accessible/www.youtube.com/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ ImprovedTube.playerPlaybackSpeed = function () {

let title = document.getElementsByTagName('meta')?.title?.content || false;
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 musicIdentifiers = /(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 Expand Up @@ -728,7 +728,11 @@ ImprovedTube.playerPopupButton = function () {

player.pauseVideo();

window.open('//www.youtube.com/embed/' + location.href.match(/watch\?v=([A-Za-z0-9\-\_]+)/g)[0].slice(8) + '?start=' + parseInt(player.getCurrentTime()) + '&autoplay=' + (ImprovedTube.storage.player_autoplay == false ? '0' : '1'), '_blank', 'directories=no,toolbar=no,location=no,menubar=no,status=no,titlebar=no,scrollbars=no,resizable=no,width=' + player.offsetWidth + ',height=' + player.offsetHeight);
let urlPopup = `${location.protocol}//www.youtube.com/embed/${location.search.match(ImprovedTube.regex.video_id)[1]}?start=${parseInt(player.getCurrentTime())}&autoplay=${(ImprovedTube.storage.player_autoplay ?? true) ? '1' : '0'}`;
const listMatch = location.search.match(ImprovedTube.regex.playlist_id);
if (listMatch) urlPopup += `&list=${listMatch[1]}`;

window.open(urlPopup, '_blank', `directories=no,toolbar=no,location=no,menubar=no,status=no,titlebar=no,scrollbars=no,resizable=no,width=${player.offsetWidth},height=${player.offsetHeight}`);
},
title: 'Popup'
});
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 6c63fcd

Please sign in to comment.