Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ImprovedTube committed Nov 23, 2023
1 parent 100d1b3 commit 257db41
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 19 deletions.
1 change: 0 additions & 1 deletion js&css/extension/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ extension.events.on('init', function () {
extension.features.relatedVideos();
extension.features.comments();
extension.features.openNewTab();
extension.features.hideVideoTitleFullScreen();
bodyReady();
});

Expand Down
18 changes: 0 additions & 18 deletions js&css/extension/www.youtube.com/appearance/player/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,6 @@
/*--------------------------------------------------------------
#
--------------------------------------------------------------*/


/*--------------------------------------------------------------
# HIDE VIDEO TITLE IN FULLSCREEN
--------------------------------------------------------------*/

extension.features.hideVideoTitleFullScreen = function (){
document.addEventListener('fullscreenchange', function (){
if(document.fullscreenElement){
const youtubeTitle = document.querySelector(".ytp-title-text > a");

if(youtubeTitle){
if (extension.storage.get("hide_video_title_fullScreen") === true) {
youtubeTitle.style.display = "none";
}else{
youtubeTitle.style.display = "block";
}
}
}
});
}
3 changes: 3 additions & 0 deletions js&css/web-accessible/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,9 @@ document.addEventListener('it-message-from-extension', function () {
} else if ( camelized_key === 'playerRemainingDuration' ) {
if (ImprovedTube.storage.player_remaining_duration === false) {document.querySelector(".ytp-time-remaining-duration")?.remove();}
if (ImprovedTube.storage.player_remaining_duration === true) { ImprovedTube.playerRemainingDuration(); }
} else if ( camelized_key === 'hideVideoTitleFullScreen' ) {
if (ImprovedTube.storage.hide_video_title_fullScreen === false) {document.querySelector(".ytp-title-text > a")?.style.setProperty('display', 'block');}
if (ImprovedTube.storage.hide_video_title_fullScreen === true) {document.querySelector(".ytp-title-text > a")?.style.setProperty('display', 'none'); }
}
if (ImprovedTube[camelized_key]) {
try{ImprovedTube[camelized_key]()}catch{};
Expand Down
1 change: 1 addition & 0 deletions js&css/web-accessible/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ ImprovedTube.initPlayer = function () {
ImprovedTube.playerFitToWinButton();
ImprovedTube.playerHamburgerButton();
ImprovedTube.playerControls();
ImprovedTube.hideVideoTitleFullScreen();

setTimeout(function () {
ImprovedTube.forcedTheaterMode();
Expand Down
7 changes: 7 additions & 0 deletions js&css/web-accessible/www.youtube.com/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -848,6 +848,13 @@ ImprovedTube.playerControls = function (pause=false) {
}} else { player.showControls(); }
}
};
/*--------------------------------------------------------------
# HIDE VIDEO TITLE IN FULLSCREEN
--------------------------------------------------------------*/
ImprovedTube.hideVideoTitleFullScreen = function (){ if (ImprovedTube.storage.hide_video_title_fullScreen === true) {
document.addEventListener('fullscreenchange', function (){ document.querySelector(".ytp-title-text > a")?.style.setProperty('display', 'none');
})
}};
/*------------------------------------------------------------------------------
CUSTOM MINI-PLAYER
------------------------------------------------------------------------------*/
Expand Down

0 comments on commit 257db41

Please sign in to comment.