Skip to content

Commit

Permalink
Merge pull request #1848 from asifurrahaman754/hide-video-title
Browse files Browse the repository at this point in the history
  • Loading branch information
ImprovedTube authored Nov 22, 2023
2 parents ef541a5 + e4dfc25 commit b7a153a
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
3 changes: 3 additions & 0 deletions _locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1129,5 +1129,8 @@
},
"openNewTab": {
"message": "Open in new tab"
},
"hideVideoTitleFullScreen": {
"message": "Hide video title in fullscreen"
}
}
1 change: 1 addition & 0 deletions js&css/extension/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ extension.events.on('init', function () {
extension.features.relatedVideos();
extension.features.comments();
extension.features.openNewTab();
extension.features.hideVideoTitleFullScreen();
bodyReady();
});

Expand Down
20 changes: 20 additions & 0 deletions js&css/extension/www.youtube.com/appearance/player/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,23 @@
#
--------------------------------------------------------------*/


/*--------------------------------------------------------------
# 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";
}
}
}
});
}
4 changes: 4 additions & 0 deletions menu/skeleton-parts/appearance.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,10 @@ extension.skeleton.main.layers.section.appearance.on.click.player = {
component: "switch",
text: "hideScrollForDetails",
tags: "remove,hide"
},
hide_video_title_fullScreen: {
component: "switch",
text: "hideVideoTitleFullScreen",
}
}
}
Expand Down

0 comments on commit b7a153a

Please sign in to comment.