From dea28ca75e39ae7f496d9c875c3e43fa658b3f80 Mon Sep 17 00:00:00 2001
From: AlexChulo <144053390+AlexChulo@users.noreply.github.com>
Date: Tue, 14 Oct 2025 17:15:54 +0200
Subject: [PATCH 1/5] Add refresh categories button and functionality
Introduces a 'Refresh Categories' button to the menu and sidepanel, with supporting JavaScript to trigger a refresh of YouTube categories via content script messaging. Updates CSS for button styling and adds logic to reload the chip bar on YouTube when requested.
---
js&css/extension/functions.js | 61 ++++++++++++++++++++-
menu/index.html | 1 +
menu/satus.css | 6 +-
menu/sidepanel.html | 1 +
menu/skeleton-parts/refresh-categories.js | 67 +++++++++++++++++++++++
5 files changed, 131 insertions(+), 5 deletions(-)
create mode 100644 menu/skeleton-parts/refresh-categories.js
diff --git a/js&css/extension/functions.js b/js&css/extension/functions.js
index 4b6c9f742..60c4a73b0 100644
--- a/js&css/extension/functions.js
+++ b/js&css/extension/functions.js
@@ -6,4 +6,63 @@
extension.functions.getUrlParameter = function (url, parameter) {
var match = url.match(new RegExp('(\\?|\\&)' + parameter + '=[^&]+'));
if (match) {return match[0].substr(3);}
-};
\ No newline at end of file
+};
+
+/*--------------------------------------------------------------
+# REFRESH YOUTUBE CATEGORIES
+--------------------------------------------------------------*/
+console.log('Content script loaded!', window.location.href);
+
+if (!window.improvedTubeListenerAdded && chrome && chrome.runtime) {
+ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
+ if (request.action === 'refresh-youtube-categories') {
+ console.log('Refresh categories request received');
+
+ let responded = false;
+
+ function refreshChipBar(chipContainer) {
+ const parent = chipContainer.parentNode;
+ const nextSibling = chipContainer.nextSibling;
+
+ parent.removeChild(chipContainer);
+
+ void parent.offsetHeight;
+
+ requestAnimationFrame(() => {
+ parent.insertBefore(chipContainer, nextSibling);
+ if (!responded) {
+ sendResponse({ success: true });
+ responded = true;
+ }
+ });
+ }
+
+ let chipContainer = document.querySelector('ytd-feed-filter-chip-bar-renderer');
+ if (chipContainer) {
+ refreshChipBar(chipContainer);
+ } else {
+ console.log('Chip bar not found, observing DOM...');
+ const observer = new MutationObserver((mutations, obs) => {
+ chipContainer = document.querySelector('ytd-feed-filter-chip-bar-renderer');
+ if (chipContainer) {
+ refreshChipBar(chipContainer);
+ obs.disconnect();
+ }
+ });
+ observer.observe(document.body, { childList: true, subtree: true });
+
+ setTimeout(() => {
+ if (!responded) {
+ sendResponse({ success: false, error: 'Chip container not found in time' });
+ responded = true;
+ observer.disconnect();
+ }
+ }, 5000);
+ }
+
+ return true;
+ }
+ });
+
+ window.improvedTubeListenerAdded = true;
+}
\ No newline at end of file
diff --git a/menu/index.html b/menu/index.html
index 6a3ef371f..82ca0abc2 100644
--- a/menu/index.html
+++ b/menu/index.html
@@ -19,6 +19,7 @@
+
diff --git a/menu/satus.css b/menu/satus.css
index cdc113919..c3bef1712 100644
--- a/menu/satus.css
+++ b/menu/satus.css
@@ -15,11 +15,9 @@ div:not([home-style="list"]) .satus-button--themes, div:not([home-style="list"])
margin-left: -5px !important;
margin-right: -28px !important;
}
-div:not([home-style="list"]) .satus-button--blocklist, div:not([home-style="list"]) .satus-button--analyzer {
+div:not([home-style="list"]) .satus-button--blocklist, div:not([home-style="list"]) .satus-button--analyzer, div:not([home-style="list"]) .satus-button--refresh-categories {
transform: scale(0.78);
margin-top: -22px !important;
- margin-left: 110px !important;
- margin-right: -150px !important;
}
div[home-style="list"] .satus-button--themes, div[home-style="list"] .satus-button--playlist,div[home-style="list"] .satus-button--channel, div[home-style="list"] .satus-button--shortcuts {
@@ -29,7 +27,7 @@ div[home-style="list"] .satus-button--themes, div[home-style="list"] .satus-butt
max-width: 197px !important;
margin-top:2px !important;
}
-div[home-style="list"] .satus-button--blocklist, div[home-style="list"] .satus-button--analyzer {
+div[home-style="list"] .satus-button--blocklist, div[home-style="list"] .satus-button--analyzer , div[home-style="list"] .satus-button--refresh-categories {
transform: scale(0.75);
margin-left: 165px !important;
max-width: 141px !important;
diff --git a/menu/sidepanel.html b/menu/sidepanel.html
index b3e786295..3f6c0afe5 100644
--- a/menu/sidepanel.html
+++ b/menu/sidepanel.html
@@ -20,6 +20,7 @@
+
diff --git a/menu/skeleton-parts/refresh-categories.js b/menu/skeleton-parts/refresh-categories.js
new file mode 100644
index 000000000..db47a0499
--- /dev/null
+++ b/menu/skeleton-parts/refresh-categories.js
@@ -0,0 +1,67 @@
+/*--------------------------------------------------------------
+>>> REFRESH CATEGORIES
+--------------------------------------------------------------*/
+
+extension.skeleton.main.layers.section.refreshCategories = {
+ component: 'button',
+ variant: 'refresh-categories',
+ category: true,
+ on: {
+ click: function() {
+ if (typeof chrome !== 'undefined' && chrome.tabs) {
+ chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
+ if (tabs[0] && tabs[0].url && tabs[0].url.includes('youtube.com')) {
+ chrome.tabs.sendMessage(tabs[0].id, {
+ action: 'refresh-youtube-categories'
+ }, function(response) {
+ if (chrome.runtime.lastError) {
+ chrome.tabs.reload(tabs[0].id);
+ } else {
+ if (!response || !response.success) {
+ chrome.tabs.reload(tabs[0].id);
+ }
+ }
+ });
+ }
+ });
+ }
+ }
+ },
+ icon: {
+ component: 'span',
+
+ svg: {
+ component: 'svg',
+ attr: {
+ 'viewBox': '0 0 24 24',
+ 'fill': 'transparent',
+ 'stroke': 'currentColor',
+ 'stroke-linecap': 'round',
+ 'stroke-width': '1.75'
+ },
+
+ path1: {
+ component: 'path',
+ attr: {
+ 'd': 'M1 4v6h6'
+ }
+ },
+ path2: {
+ component: 'path',
+ attr: {
+ 'd': 'M23 20v-6h-6'
+ }
+ },
+ path3: {
+ component: 'path',
+ attr: {
+ 'd': 'M20.49 9A9 9 0 0 0 5.64 5.64L1 10m22 4l-4.64 4.36A9 9 0 0 1 3.51 15'
+ }
+ }
+ }
+ },
+ label: {
+ component: 'span',
+ text: 'Categories'
+ }
+};
From 530e26346eb1bd3b7f66adcd145a0cf26005ec02 Mon Sep 17 00:00:00 2001
From: AlexChulo <144053390+AlexChulo@users.noreply.github.com>
Date: Sun, 19 Oct 2025 14:23:19 +0200
Subject: [PATCH 2/5] Refactor YouTube categories refresh logic
Simplifies and improves the refresh logic for YouTube categories by updating the content script and menu button behavior. Adds 'tabs' permission to manifest for messaging and tab reloads, and removes unnecessary reload and error handling from the refresh button click handler.
---
js&css/extension/functions.js | 75 ++++++---------
manifest.json | 2 +-
menu/skeleton-parts/refresh-categories.js | 112 ++++++++++------------
3 files changed, 81 insertions(+), 108 deletions(-)
diff --git a/js&css/extension/functions.js b/js&css/extension/functions.js
index 60c4a73b0..27974fab3 100644
--- a/js&css/extension/functions.js
+++ b/js&css/extension/functions.js
@@ -11,58 +11,41 @@ extension.functions.getUrlParameter = function (url, parameter) {
/*--------------------------------------------------------------
# REFRESH YOUTUBE CATEGORIES
--------------------------------------------------------------*/
-console.log('Content script loaded!', window.location.href);
-
-if (!window.improvedTubeListenerAdded && chrome && chrome.runtime) {
- chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
+if (!window.improvedTubeRefreshCategoriesAdded && typeof chrome !== 'undefined' && chrome.runtime) {
+ chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
if (request.action === 'refresh-youtube-categories') {
- console.log('Refresh categories request received');
-
- let responded = false;
-
- function refreshChipBar(chipContainer) {
- const parent = chipContainer.parentNode;
- const nextSibling = chipContainer.nextSibling;
+ let chipContainer = document.querySelector('ytd-feed-filter-chip-bar-renderer');
+
+ if (chipContainer) {
+ chipContainer.style.display = '';
+ chipContainer.style.visibility = 'visible';
+ chipContainer.style.opacity = '1';
+ chipContainer.hidden = false;
- parent.removeChild(chipContainer);
+ let parent = chipContainer.parentElement;
+ while (parent && parent !== document.body) {
+ parent.style.display = '';
+ parent.style.visibility = 'visible';
+ parent = parent.parentElement;
+ }
- void parent.offsetHeight;
+ const allChips = chipContainer.querySelectorAll('yt-chip-cloud-chip-renderer button');
+ if (allChips.length > 1) {
+ allChips[1].click();
+ setTimeout(function() {
+ allChips[0].click();
+ }, 200);
+ }
- requestAnimationFrame(() => {
- parent.insertBefore(chipContainer, nextSibling);
- if (!responded) {
- sendResponse({ success: true });
- responded = true;
- }
- });
- }
-
- let chipContainer = document.querySelector('ytd-feed-filter-chip-bar-renderer');
- if (chipContainer) {
- refreshChipBar(chipContainer);
+ sendResponse({ success: true });
} else {
- console.log('Chip bar not found, observing DOM...');
- const observer = new MutationObserver((mutations, obs) => {
- chipContainer = document.querySelector('ytd-feed-filter-chip-bar-renderer');
- if (chipContainer) {
- refreshChipBar(chipContainer);
- obs.disconnect();
- }
- });
- observer.observe(document.body, { childList: true, subtree: true });
-
- setTimeout(() => {
- if (!responded) {
- sendResponse({ success: false, error: 'Chip container not found in time' });
- responded = true;
- observer.disconnect();
- }
- }, 5000);
+ window.location.reload();
+ sendResponse({ success: true });
}
-
- return true;
+
+ return true;
}
});
-
- window.improvedTubeListenerAdded = true;
+
+ window.improvedTubeRefreshCategoriesAdded = true;
}
\ No newline at end of file
diff --git a/manifest.json b/manifest.json
index 589992ce9..e5f47e50c 100644
--- a/manifest.json
+++ b/manifest.json
@@ -59,7 +59,7 @@
],
"host_permissions": ["https://www.youtube.com/*"],
"optional_permissions": ["downloads"],
- "permissions": ["contextMenus", "storage"],
+ "permissions": ["contextMenus", "storage" , "tabs"],
"web_accessible_resources": [
{
"resources": [
diff --git a/menu/skeleton-parts/refresh-categories.js b/menu/skeleton-parts/refresh-categories.js
index db47a0499..e60be4b6a 100644
--- a/menu/skeleton-parts/refresh-categories.js
+++ b/menu/skeleton-parts/refresh-categories.js
@@ -3,65 +3,55 @@
--------------------------------------------------------------*/
extension.skeleton.main.layers.section.refreshCategories = {
- component: 'button',
- variant: 'refresh-categories',
- category: true,
- on: {
- click: function() {
- if (typeof chrome !== 'undefined' && chrome.tabs) {
- chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
- if (tabs[0] && tabs[0].url && tabs[0].url.includes('youtube.com')) {
- chrome.tabs.sendMessage(tabs[0].id, {
- action: 'refresh-youtube-categories'
- }, function(response) {
- if (chrome.runtime.lastError) {
- chrome.tabs.reload(tabs[0].id);
- } else {
- if (!response || !response.success) {
- chrome.tabs.reload(tabs[0].id);
- }
- }
- });
- }
- });
- }
- }
- },
- icon: {
- component: 'span',
-
- svg: {
- component: 'svg',
- attr: {
- 'viewBox': '0 0 24 24',
- 'fill': 'transparent',
- 'stroke': 'currentColor',
- 'stroke-linecap': 'round',
- 'stroke-width': '1.75'
- },
-
- path1: {
- component: 'path',
- attr: {
- 'd': 'M1 4v6h6'
- }
- },
- path2: {
- component: 'path',
- attr: {
- 'd': 'M23 20v-6h-6'
- }
- },
- path3: {
- component: 'path',
- attr: {
- 'd': 'M20.49 9A9 9 0 0 0 5.64 5.64L1 10m22 4l-4.64 4.36A9 9 0 0 1 3.51 15'
- }
- }
- }
- },
- label: {
- component: 'span',
- text: 'Categories'
- }
+ component: 'button',
+ variant: 'refresh-categories',
+ category: true,
+ on: {
+ click: function() {
+ if (typeof chrome !== 'undefined' && chrome.tabs) {
+ chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
+ if (tabs[0] && tabs[0].url && tabs[0].url.includes('youtube.com')) {
+ chrome.tabs.sendMessage(tabs[0].id, {
+ action: 'refresh-youtube-categories'
+ });
+ }
+ });
+ }
+ }
+ },
+ icon: {
+ component: 'span',
+ svg: {
+ component: 'svg',
+ attr: {
+ 'viewBox': '0 0 24 24',
+ 'fill': 'none',
+ 'stroke': 'currentColor',
+ 'stroke-linecap': 'round',
+ 'stroke-width': '1.75'
+ },
+ path1: {
+ component: 'path',
+ attr: {
+ 'd': 'M1 4v6h6'
+ }
+ },
+ path2: {
+ component: 'path',
+ attr: {
+ 'd': 'M23 20v-6h-6'
+ }
+ },
+ path3: {
+ component: 'path',
+ attr: {
+ 'd': 'M20.49 9A9 9 0 0 0 5.64 5.64L1 10m22 4l-4.64 4.36A9 9 0 0 1 3.51 15'
+ }
+ }
+ }
+ },
+ label: {
+ component: 'span',
+ text: 'Categories'
+ }
};
From 52e10f2099ffa34add987160e0a764e50f70b5f8 Mon Sep 17 00:00:00 2001
From: AlexChulo <144053390+AlexChulo@users.noreply.github.com>
Date: Tue, 4 Nov 2025 01:15:31 +0100
Subject: [PATCH 3/5] Add category refresh button and shortcut
Introduces a new 'category refresh' button to the YouTube UI, allowing users to restore categories with a single click. The refresh logic is moved from the extension background to the content script for direct interaction. A keyboard shortcut for refreshing categories is also added. Menu and localization files are updated to support the new feature, and the obsolete refresh-categories menu part is removed.
---
_locales/en/messages.json | 8 +-
js&css/extension/functions.js | 44 +------
js&css/web-accessible/init.js | 107 +++++++++++++++++-
.../www.youtube.com/shortcuts.js | 30 +++++
menu/satus.css | 10 +-
menu/skeleton-parts/general.js | 4 +
menu/skeleton-parts/refresh-categories.js | 57 ----------
menu/skeleton-parts/shortcuts.js | 4 +
8 files changed, 156 insertions(+), 108 deletions(-)
delete mode 100644 menu/skeleton-parts/refresh-categories.js
diff --git a/_locales/en/messages.json b/_locales/en/messages.json
index 50a7e823e..beec48709 100644
--- a/_locales/en/messages.json
+++ b/_locales/en/messages.json
@@ -1513,5 +1513,11 @@
},
"excludeShortsInPlayAll": {
"message": "Exclude Shorts when using \"Play all\""
- }
+ },
+ "categoryRefreshButton": {
+ "message": "Add category refresh button"
+},
+"refreshCategories": {
+ "message": "Refresh categories"
}
+}
\ No newline at end of file
diff --git a/js&css/extension/functions.js b/js&css/extension/functions.js
index 27974fab3..4b6c9f742 100644
--- a/js&css/extension/functions.js
+++ b/js&css/extension/functions.js
@@ -6,46 +6,4 @@
extension.functions.getUrlParameter = function (url, parameter) {
var match = url.match(new RegExp('(\\?|\\&)' + parameter + '=[^&]+'));
if (match) {return match[0].substr(3);}
-};
-
-/*--------------------------------------------------------------
-# REFRESH YOUTUBE CATEGORIES
---------------------------------------------------------------*/
-if (!window.improvedTubeRefreshCategoriesAdded && typeof chrome !== 'undefined' && chrome.runtime) {
- chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
- if (request.action === 'refresh-youtube-categories') {
- let chipContainer = document.querySelector('ytd-feed-filter-chip-bar-renderer');
-
- if (chipContainer) {
- chipContainer.style.display = '';
- chipContainer.style.visibility = 'visible';
- chipContainer.style.opacity = '1';
- chipContainer.hidden = false;
-
- let parent = chipContainer.parentElement;
- while (parent && parent !== document.body) {
- parent.style.display = '';
- parent.style.visibility = 'visible';
- parent = parent.parentElement;
- }
-
- const allChips = chipContainer.querySelectorAll('yt-chip-cloud-chip-renderer button');
- if (allChips.length > 1) {
- allChips[1].click();
- setTimeout(function() {
- allChips[0].click();
- }, 200);
- }
-
- sendResponse({ success: true });
- } else {
- window.location.reload();
- sendResponse({ success: true });
- }
-
- return true;
- }
- });
-
- window.improvedTubeRefreshCategoriesAdded = true;
-}
\ No newline at end of file
+};
\ No newline at end of file
diff --git a/js&css/web-accessible/init.js b/js&css/web-accessible/init.js
index d1963d826..6e3bf4b5c 100644
--- a/js&css/web-accessible/init.js
+++ b/js&css/web-accessible/init.js
@@ -73,6 +73,107 @@ if (ImprovedTube.storage.channel_default_tab && ImprovedTube.storage.channel_def
subtree: true
});
}
+/*--------------------------------------------------------------
+# CATEGORY REFRESH BUTTON
+--------------------------------------------------------------*/
+ImprovedTube.categoryRefreshButton = function () {
+ if (this.storage.category_refresh_button !== true) {
+ return;
+ }
+
+ function addRefreshButton() {
+ if (document.querySelector('.it-category-refresh-btn')) {
+ return;
+ }
+
+ const button = document.createElement('button');
+ button.className = 'it-category-refresh-btn';
+ button.title = 'Restore categories';
+ button.setAttribute('aria-label', 'Restore categories');
+ button.style.cssText = 'background: transparent; border: none; padding: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; color: var(--yt-spec-icon-inactive); position: relative;';
+
+ const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
+ svg.setAttribute('width', '24');
+ svg.setAttribute('height', '24');
+ svg.setAttribute('viewBox', '0 0 24 24');
+ svg.setAttribute('fill', 'none');
+ svg.setAttribute('stroke', 'currentColor');
+ svg.setAttribute('stroke-width', '2');
+ svg.setAttribute('stroke-linecap', 'round');
+ svg.style.display = 'block';
+
+ const path1 = document.createElementNS('http://www.w3.org/2000/svg', 'path');
+ path1.setAttribute('d', 'M1 4v6h6');
+
+ const path2 = document.createElementNS('http://www.w3.org/2000/svg', 'path');
+ path2.setAttribute('d', 'M23 20v-6h-6');
+
+ const path3 = document.createElementNS('http://www.w3.org/2000/svg', 'path');
+ path3.setAttribute('d', 'M20.49 9A9 9 0 0 0 5.64 5.64L1 10m22 4l-4.64 4.36A9 9 0 0 1 3.51 15');
+
+ svg.appendChild(path1);
+ svg.appendChild(path2);
+ svg.appendChild(path3);
+ button.appendChild(svg);
+
+ button.addEventListener('mouseenter', function() {
+ this.style.background = 'var(--yt-spec-badge-chip-background)';
+ this.style.borderRadius = '50%';
+ });
+ button.addEventListener('mouseleave', function() {
+ this.style.background = 'transparent';
+ });
+
+ button.addEventListener('click', function() {
+ let chipContainer = document.querySelector('ytd-feed-filter-chip-bar-renderer');
+
+ if (chipContainer) {
+ chipContainer.style.display = '';
+ chipContainer.style.visibility = 'visible';
+ chipContainer.style.opacity = '1';
+ chipContainer.hidden = false;
+
+ let parent = chipContainer.parentElement;
+ while (parent && parent !== document.body) {
+ parent.style.display = '';
+ parent.style.visibility = 'visible';
+ parent = parent.parentElement;
+ }
+
+ const allChips = chipContainer.querySelectorAll('yt-chip-cloud-chip-renderer button');
+ if (allChips.length > 1) {
+ allChips[1].click();
+ setTimeout(function() {
+ allChips[0].click();
+ }, 200);
+ }
+ } else {
+ window.location.reload();
+ }
+ });
+
+ const mastheadButtons = document.querySelector('ytd-masthead #end #buttons');
+ if (mastheadButtons) {
+ mastheadButtons.insertBefore(button, mastheadButtons.firstChild);
+ }
+ }
+
+ addRefreshButton();
+
+ const mastheadObserver = new MutationObserver(function() {
+ if (!document.querySelector('.it-category-refresh-btn')) {
+ const mastheadButtons = document.querySelector('ytd-masthead #end #buttons');
+ if (mastheadButtons && mastheadButtons.children.length > 0) {
+ addRefreshButton();
+ }
+ }
+ });
+
+ const masthead = document.querySelector('ytd-masthead');
+ if (masthead) {
+ mastheadObserver.observe(masthead, { childList: true, subtree: true });
+ }
+};
ImprovedTube.init = function () {
window.addEventListener('yt-page-data-updated', function () {
@@ -85,7 +186,7 @@ ImprovedTube.init = function () {
ImprovedTube.playlistCopyVideoIdButton();
ImprovedTube.playlistCompleteInit();
}
- try { if (ImprovedTube.lastWatchedOverlay) ImprovedTube.lastWatchedOverlay(); } catch (e) { console.error('[LWO] page-data-updated error', e); }
+ try { if (ImprovedTube.lastWatchedOverlay) ImprovedTube.lastWatchedOverlay(); } catch (e) { console.error('[LWO] page-data-updated error', e); }
});
this.pageType();
this.playerOnPlay();
@@ -97,6 +198,7 @@ ImprovedTube.init = function () {
this.myColors();
this.YouTubeExperiments();
this.channelCompactTheme();
+ this.categoryRefreshButton();
if (ImprovedTube.elements.player && ImprovedTube.elements.player.setPlaybackRate) {
ImprovedTube.videoPageUpdate();
@@ -140,7 +242,8 @@ document.addEventListener('yt-navigate-finish', function () {
ImprovedTube.pageType();
ImprovedTube.YouTubeExperiments();
ImprovedTube.commentsSidebar();
- try { if (ImprovedTube.lastWatchedOverlay) ImprovedTube.lastWatchedOverlay(); } catch (e) { console.error('[LWO] nav-finish error', e); }
+ ImprovedTube.categoryRefreshButton();
+ try { if (ImprovedTube.lastWatchedOverlay) ImprovedTube.lastWatchedOverlay(); } catch (e) { console.error('[LWO] nav-finish error', e); }
if (ImprovedTube.elements.player && ImprovedTube.elements.player.setPlaybackRate) {
ImprovedTube.videoPageUpdate();
diff --git a/js&css/web-accessible/www.youtube.com/shortcuts.js b/js&css/web-accessible/www.youtube.com/shortcuts.js
index 924411870..afb5bde4b 100644
--- a/js&css/web-accessible/www.youtube.com/shortcuts.js
+++ b/js&css/web-accessible/www.youtube.com/shortcuts.js
@@ -579,3 +579,33 @@ ImprovedTube.shortcutRotateVideo = function () {
ImprovedTube.shortcutActivateFitToWindow = function() {
ImprovedTube.toggleFitToWindow();
};
+/*------------------------------------------------------------------------------
+4.7.31 REFRESH CATEGORIES
+------------------------------------------------------------------------------*/
+ImprovedTube.shortcutRefreshCategories = function () {
+ let chipContainer = document.querySelector('ytd-feed-filter-chip-bar-renderer');
+
+ if (chipContainer) {
+ chipContainer.style.display = '';
+ chipContainer.style.visibility = 'visible';
+ chipContainer.style.opacity = '1';
+ chipContainer.hidden = false;
+
+ let parent = chipContainer.parentElement;
+ while (parent && parent !== document.body) {
+ parent.style.display = '';
+ parent.style.visibility = 'visible';
+ parent = parent.parentElement;
+ }
+
+ const allChips = chipContainer.querySelectorAll('yt-chip-cloud-chip-renderer button');
+ if (allChips.length > 1) {
+ allChips[1].click();
+ setTimeout(function() {
+ allChips[0].click();
+ }, 200);
+ }
+ } else {
+ window.location.reload();
+ }
+};
\ No newline at end of file
diff --git a/menu/satus.css b/menu/satus.css
index c3bef1712..afbb3eddf 100644
--- a/menu/satus.css
+++ b/menu/satus.css
@@ -15,9 +15,11 @@ div:not([home-style="list"]) .satus-button--themes, div:not([home-style="list"])
margin-left: -5px !important;
margin-right: -28px !important;
}
-div:not([home-style="list"]) .satus-button--blocklist, div:not([home-style="list"]) .satus-button--analyzer, div:not([home-style="list"]) .satus-button--refresh-categories {
+div:not([home-style="list"]) .satus-button--blocklist, div:not([home-style="list"]) .satus-button--analyzer {
transform: scale(0.78);
margin-top: -22px !important;
+ margin-left: 110px !important;
+ margin-right: -150px !important;
}
div[home-style="list"] .satus-button--themes, div[home-style="list"] .satus-button--playlist,div[home-style="list"] .satus-button--channel, div[home-style="list"] .satus-button--shortcuts {
@@ -27,7 +29,7 @@ div[home-style="list"] .satus-button--themes, div[home-style="list"] .satus-butt
max-width: 197px !important;
margin-top:2px !important;
}
-div[home-style="list"] .satus-button--blocklist, div[home-style="list"] .satus-button--analyzer , div[home-style="list"] .satus-button--refresh-categories {
+div[home-style="list"] .satus-button--blocklist, div[home-style="list"] .satus-button--analyzer {
transform: scale(0.75);
margin-left: 165px !important;
max-width: 141px !important;
@@ -2006,6 +2008,4 @@ As our Syntax markup isnt read for