Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion _locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@
"message": "Hide date"
},
"hideDetailButton": {
"message": "Buttons (below the player)"
"message": "Hide detail button"
},
"hideDetails": {
"message": "Hide details"
Expand Down Expand Up @@ -1424,5 +1424,11 @@
},
"pauseWhileIAmTypingOnYouTube": {
"message": "Pause when I'm typing on YouTube"
},
"hideCustomizeMenu": {
"message": "Hide customize menu"
},
"hideAISummary": {
"message": "Hide AI summary below player"
}
}
98 changes: 98 additions & 0 deletions background.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,91 @@ chrome.runtime.onInstalled.addListener(function (installed) {
});
}
});
chrome.storage.local.get('comments_sidebar_simple', function (result) {
if (result.comments_sidebar_simple === true) {
chrome.storage.local.set({comments_sidebar_simple: true});
}
});
chrome.storage.local.get('hide_animated_thumbnails', function (result) {
if (result.hide_animated_thumbnails === true) {
chrome.storage.local.set({hide_animated_thumbnails: true});
}
});
chrome.storage.local.get('hide_cards', function (result) {
if (result.hide_cards === true) {
chrome.storage.local.set({hide_cards: true});
}
});
chrome.storage.local.get('hide_comments', function (result) {
if (result.hide_comments === true) {
chrome.storage.local.set({hide_comments: true});
}
});
chrome.storage.local.get('hide_comments_count', function (result) {
if (result.hide_comments_count === true) {
chrome.storage.local.set({hide_comments_count: true});
}
});
chrome.storage.local.get('hide_details', function (result) {
if (result.hide_details === true) {
chrome.storage.local.set({hide_details: true});
}
});
chrome.storage.local.get('hide_views_count', function (result) {
if (result.hide_views_count === true) {
chrome.storage.local.set({hide_views_count: true});
}
});
chrome.storage.local.get('hide_date', function (result) {
if (result.hide_date === true) {
chrome.storage.local.set({hide_date: true});
}
});
chrome.storage.local.get('hide_share_button', function (result) {
if (result.hide_share_button === true) {
chrome.storage.local.set({hide_share_button: true});
}
});
chrome.storage.local.get('hide_save_button', function (result) {
if (result.hide_save_button === true) {
chrome.storage.local.set({hide_save_button: true});
}
});
chrome.storage.local.get('hide_more_button', function (result) {
if (result.hide_more_button === true) {
chrome.storage.local.set({hide_more_button: true});
}
});
chrome.storage.local.get('hide_download_button', function (result) {
if (result.hide_download_button === true) {
chrome.storage.local.set({hide_download_button: true});
}
});
chrome.storage.local.get('hide_clip_button', function (result) {
if (result.hide_clip_button === true) {
chrome.storage.local.set({hide_clip_button: true});
}
});
chrome.storage.local.get('hide_thanks_button', function (result) {
if (result.hide_thanks_button === true) {
chrome.storage.local.set({hide_thanks_button: true});
}
});
chrome.storage.local.get('hide_dislike_button', function (result) {
if (result.hide_dislike_button === true) {
chrome.storage.local.set({hide_dislike_button: true});
}
});
chrome.storage.local.get('hide_report_button', function (result) {
if (result.hide_report_button === true) {
chrome.storage.local.set({hide_report_button: true});
}
});
chrome.storage.local.get('hide_ai_summary', function (result) {
if (result.hide_ai_summary === true) {
chrome.storage.local.set({hide_ai_summary: true});
}
});
} else if (installed.reason == 'install') {
if (navigator.userAgent.indexOf("Firefox") != -1) {
chrome.storage.local.set({below_player_pip: false})
Expand Down Expand Up @@ -177,6 +262,19 @@ chrome.runtime.onInstalled.addListener(function () {
chrome.storage.onChanged.addListener(function (changes) {
if (changes?.language) updateContextMenu(changes.language.newValue);
if (changes?.improvedTubeSidebar) chrome.sidePanel.setPanelBehavior({openPanelOnActionClick: changes.language.newValue});

// Listen for hide_ai_summary changes and notify tabs
if (changes?.hide_ai_summary) {
// Query only active YouTube tabs and send the message
chrome.tabs.query({ url: "*://www.youtube.com/*" }, (tabs) => {
for (const tab of tabs) {
// Check if the tab is likely still connected (optional but good practice)
if (tabConnected[tab.id]) {
chrome.tabs.sendMessage(tab.id, { action: 'apply-hide-ai-summary' }).catch(error => console.log(`Could not send message to tab ${tab.id}: ${error.message}`)); // Add catch for potentially closed tabs
}
}
});
}
});
/*--------------------------------------------------------------
# TAB Helper, prune stale connected tabs
Expand Down
3 changes: 3 additions & 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.hideAISummary();
bodyReady();
});

Expand Down Expand Up @@ -112,6 +113,8 @@ chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) {
});
} else if (request.action === "another-video-started-playing") {
extension.features.onlyOnePlayerInstancePlaying();
} else if (request.action === 'apply-hide-ai-summary') {
extension.features.hideAISummary();
}
});

Expand Down
7 changes: 7 additions & 0 deletions js&css/extension/www.youtube.com/general/general.css
Original file line number Diff line number Diff line change
Expand Up @@ -453,3 +453,10 @@ html[it-channel-compact-theme='true'] #sections > ytd-guide-section-renderer:nth
html[it-channel-compact-theme='true'] #sections > ytd-guide-section-renderer:nth-child(4) > h3:active {
background-color: var(--yt-spec-10-percent-layer);
}

/*--------------------------------------------------------------
# HIDE AI SUMMARY
--------------------------------------------------------------*/
html[it-hide-ai-summary="true"] ytd-engagement-panel-section-list-renderer[target-id*="description"] {
display: none !important;
}
11 changes: 11 additions & 0 deletions js&css/extension/www.youtube.com/general/general.js
Original file line number Diff line number Diff line change
Expand Up @@ -578,3 +578,14 @@ extension.features.openNewTab = function () {
}
}
}

/*--------------------------------------------------------------
HIDE AI SUMMARY
--------------------------------------------------------------*/
extension.features.hideAISummary = function () {
if (isset(extension.storage.hide_ai_summary)) {
document.documentElement.setAttribute('it-hide-ai-summary', extension.storage.hide_ai_summary);
} else {
document.documentElement.removeAttribute('it-hide-ai-summary');
}
};
7 changes: 7 additions & 0 deletions js&css/extension/www.youtube.com/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ html {overflow-x: hidden !important}
/* previously also: html[it-transcript='true'] {overflow-x: hidden !important}*/
@-moz-document url-prefix() {html {overflow-x: visible !important}} /* REMOVE ME SOON https://github.com/code-charity/youtube/issues/1649 */

/*------------------------------------------------------------------------------
# HIDE AI SUMMARY
------------------------------------------------------------------------------*/
html[it-hide-ai-summary='true'] ytd-engagement-panel-section-list-renderer[target-id*="description"] {
display: none !important;
}

@media screen and (max-width: 1023px) {
div#primary ytd-live-chat-frame {width: auto !important;}
html[it-pathname*="/shorts/"] #header.style-scope ytd-engagement-panel-title-header-renderer,
Expand Down
3 changes: 1 addition & 2 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
}
},
"background": {
"service_worker": "background.js",
"scripts": ["background.js"]
"service_worker": "background.js"
},
"action": {
"default_popup": "menu/index.html",
Expand Down
5 changes: 5 additions & 0 deletions menu/skeleton-parts/general.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ extension.skeleton.main.layers.section.general = {
component: 'switch',
text: 'collapseOfSubscriptionSections'
},
hide_ai_summary: {
component: 'switch',
text: 'hideAISummary',
id: 'hide-ai-summary'
},
youtube_home_page: {
component: 'select',
text: 'youtubeHomePage',
Expand Down