Skip to content

Commit

Permalink
quick fix #1400
Browse files Browse the repository at this point in the history
  • Loading branch information
ImprovedTube committed Feb 20, 2024
1 parent 14529c9 commit 7f9e9bb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 16 deletions.
14 changes: 5 additions & 9 deletions js&css/web-accessible/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ ImprovedTube.videoPageUpdate = function () {
ImprovedTube.channelVideosCount();
ImprovedTube.upNextAutoplay();
ImprovedTube.playerAutofullscreen();
ImprovedTube.playerSize();
ImprovedTube.playerSize();
if( this.storage.player_always_repeat === true) {ImprovedTube.playerRepeat();};
ImprovedTube.playerScreenshotButton();
ImprovedTube.playerRepeatButton();
Expand Down Expand Up @@ -365,14 +365,9 @@ ImprovedTube.initPlayer = function () {
ImprovedTube.playerFitToWinButton();
ImprovedTube.playerHamburgerButton();
ImprovedTube.playerControls();

setTimeout(function () {
ImprovedTube.forcedTheaterMode();
}, 150);

if (location.href.indexOf('/embed/') === -1) {
ImprovedTube.miniPlayer();
}
ImprovedTube.expandDescription();
setTimeout(function () { ImprovedTube.forcedTheaterMode(); }, 150);
if (location.href.indexOf('/embed/') === -1) { ImprovedTube.miniPlayer(); }
}
};

Expand Down Expand Up @@ -595,3 +590,4 @@ ImprovedTube.showStatus = function (value) {

ImprovedTube.videoId = function (url = document.URL) { return url.match(ImprovedTube.regex.video_id)[1] || url.searchParams.get('v') || movie_player.getVideoData().video_id }
ImprovedTube.videoTitle = function () { return document.title?.replace(/\s*-\s*YouTube$/, '') || movie_player.getVideoData().title || document.querySelector('#title > h1 > *')?.textContent }

12 changes: 5 additions & 7 deletions js&css/web-accessible/www.youtube.com/appearance.js
Original file line number Diff line number Diff line change
Expand Up @@ -408,13 +408,11 @@ ImprovedTube.improvedtubeYoutubeButtonsUnderPlayer = function () {
/*------------------------------------------------------------------------------
EXPAND DESCRIPTION
------------------------------------------------------------------------------*/
ImprovedTube.expandDescription = function (el) {
if (this.storage.description === "expanded" || this.storage.description === "classic_expanded" )
{ if(el){ try{el.click()} catch{console.log("First click on description failed");}
console.log("Second click on description to expand"); setTimeout(function(){try{el.click();}catch{}},4000)}

try {ImprovedTube.elements.player.focus()}catch{}
}
ImprovedTube.expandDescription = function (el) {
if (this.storage.description === "expanded" || this.storage.description === "classic_expanded") {console.log("EXPAND DESCRIPTION");
if (el) {el.click(); setTimeout(function(){try{ImprovedTube.elements.player.focus(); }catch{}}, 1700); } }
else {setTimeout(function(){if (el = document.querySelector('#description-inner')) {el.click();
setTimeout(function(){try{ImprovedTube.elements.player.focus(); }catch{}}, 1700); }}, 5000); }
}
/*------------------------------------------------------------------------------
HIDE DETAIL BUTTON
Expand Down

0 comments on commit 7f9e9bb

Please sign in to comment.