From 21b454425735b5024f1d0c40d36a8062ecb2ad79 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 2 Oct 2025 08:36:28 +1000 Subject: [PATCH 1/5] Remove auto quality, causing issues --- goodtube.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/goodtube.js b/goodtube.js index f3182af..9fc72f3 100644 --- a/goodtube.js +++ b/goodtube.js @@ -858,6 +858,9 @@ let goodTube_player_setQualitySucceeded = false; let goodTube_player_setQuality_timeout = setTimeout(() => {}, 0); function goodTube_player_setAutoQuality(quality = 'highest') { + // DISABLE FOR NOW THIS IS CAUSING ISSUES + return; + // Only do this once if (goodTube_player_setQualitySucceeded) { return; From 398176c9efeb16d2cf0f8dbe07fa10abe90f8a06 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 2 Oct 2025 08:42:40 +1000 Subject: [PATCH 2/5] Minor wording update --- README.md | 2 +- goodtube.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 869ea78..e9e8263 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ This plugins helps to keep this important resource free and available to everyon ## Make a Donation **This adblocker is 100% free to use and always will be.
-It has helped over 100,000 people remove the unbearable ads from Youtube.**
+It has helped over 120,000 people remove the unbearable ads from Youtube.**
This project has been made entirely by myself, as just one developer. Countless hours and late nights have gone into making this and I continue to work on updating and maintaining the project regularly. I remain dedicated to ensuring this solution continues to work for everyone (despite Youtube's best efforts to stop adblockers).
diff --git a/goodtube.js b/goodtube.js index 9fc72f3..4a976de 100644 --- a/goodtube.js +++ b/goodtube.js @@ -860,7 +860,7 @@ function goodTube_player_setAutoQuality(quality = 'highest') { // DISABLE FOR NOW THIS IS CAUSING ISSUES return; - + // Only do this once if (goodTube_player_setQualitySucceeded) { return; @@ -1804,7 +1804,7 @@
This adblocker is 100% free to use and always will be.
- It has helped over 100,000 people remove the unbearable ads from Youtube.

+ It has helped over 120,000 people remove the unbearable ads from Youtube.

This project has been made entirely by myself, as just one developer. Countless hours and late nights have gone into making this and I continue to work on updating and maintaining the project regularly. I remain dedicated to ensuring this solution continues to work for everyone (despite Youtube's best efforts to stop adblockers).

From 4250dc90fa8898554e8b750f206c4e75aa5c2948 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 2 Oct 2025 18:02:12 +1000 Subject: [PATCH 3/5] Audio flash fix --- goodtube.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/goodtube.js b/goodtube.js index 4a976de..d9bf198 100644 --- a/goodtube.js +++ b/goodtube.js @@ -1566,7 +1566,7 @@ goodTube_page_api = document.getElementById('movie_player'); // Make sure the API is all good - if (!goodTube_page_api || typeof goodTube_page_api.seekTo !== 'function' || typeof goodTube_page_api.playVideo !== 'function') { + if (!goodTube_page_api || typeof goodTube_page_api.seekTo !== 'function' || typeof goodTube_page_api.playVideo !== 'function' || typeof goodTube_page_api.mute !== 'function' || typeof goodTube_page_api.setVolume !== 'function') { return; } @@ -1583,6 +1583,10 @@ // Sync the current time using the page API - 500ms (this is the only reliable way) goodTube_page_api.seekTo((syncTime - .5)); + // Then mute the video via the page API (this helps to prevent audio flashes) + goodTube_page_api.mute(); + goodTube_page_api.setVolume(0); + // Then mute the video via HTML (playing it unmutes it for some reason) youtubeVideoElement.volume = 0; youtubeVideoElement.muted = true; From 9d8677a629efc380d67bbc3fe76a8cf12deee78a Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 3 Oct 2025 08:13:14 +1000 Subject: [PATCH 4/5] Fallback fixes, URL fixes for live videos --- goodtube.js | 103 ++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 75 insertions(+), 28 deletions(-) diff --git a/goodtube.js b/goodtube.js index d9bf198..740aff4 100644 --- a/goodtube.js +++ b/goodtube.js @@ -27,6 +27,25 @@ getParams[decode(arguments[1])] = decode(arguments[2]); }); + // For some users, the URL will contain the video ID as part of the URL + // Example - "/watch/xxxx" or "/live/xxxx" + // In this case, we want to add it manually as "v" (just like for /watch?v=xxxx) + if (goodTube_helper_watchingVideo() && typeof getParams['v'] === 'undefined') { + let splitString = ''; + if (window.location.href.indexOf('/watch') !== -1) { + splitString = '/watch'; + } + else { + splitString = '/live'; + } + + let bits = window.location.href.split(splitString); + if (bits.length === 2) { + let endBits = bits[1].split('?'); + getParams['v'] = endBits[endBits.length - 1]; + } + } + return getParams; } @@ -123,6 +142,18 @@ } } + // Check if we're watching a video + function goodTube_helper_watchingVideo() { + // If the URL contains "/watch" or "/live", we're viewing a video + if (window.location.href.indexOf('/watch') !== -1 || window.location.href.indexOf('/live') !== -1) { + return true; + } + // Otherwise, we're not viewing a video + else { + return false; + } + } + /* Global variables ------------------------------------------------------------------------------------------ */ @@ -495,7 +526,7 @@ if ( (goodTube_shorts === 'true' && window.location.href.indexOf('/shorts') !== -1) || - window.location.href.indexOf('/watch?') === -1 + !goodTube_helper_watchingVideo() ) { // Clear timeout first to solve memory leak issues clearTimeout(goodTube_youtube_pauseMuteVideos_timeout); @@ -591,7 +622,7 @@ let goodTube_youtube_checkAdsState_timeout = setTimeout(() => {}, 0); function goodTube_youtube_checkAdsState() { // If we're viewing a video - if (window.location.href.indexOf('/watch?') !== -1) { + if (goodTube_helper_watchingVideo()) { // Get the ads DOM elements let adsElement = document.querySelector('.video-ads'); let sponsoredAdsElement = document.querySelector('.ad-simple-attributed-string'); @@ -700,7 +731,7 @@ let goodTube_clearedPlayer = false; function goodTube_player_positionAndSize() { // If we're viewing a video - if (window.location.href.indexOf('/watch?') !== -1) { + if (goodTube_helper_watchingVideo()) { // If the "hide and mute ads" fallback is inactive if (goodTube_fallback) { if (!goodTube_clearedPlayer) { @@ -815,7 +846,7 @@ // If we're loading for the first time if (goodTube_firstLoad) { // If we're not viewing a video - if (window.location.href.indexOf('/watch?') === -1) { + if (!goodTube_helper_watchingVideo()) { // Clear and hide the player goodTube_player_clear(); } @@ -867,7 +898,7 @@ } // Make sure we're watching a video - if (window.location.href.indexOf('/watch?') === -1) { + if (!goodTube_helper_watchingVideo()) { return; } @@ -1147,7 +1178,7 @@ let keyPressed = event.key.toLowerCase(); // Don't do anything IF we're holding control OR alt OR the command key (mac) OR we're not watching a video - if (event.ctrlKey || event.altKey || event.metaKey || window.location.href.indexOf('/watch?') === -1) { + if (event.ctrlKey || event.altKey || event.metaKey || !goodTube_helper_watchingVideo()) { return; } @@ -1555,7 +1586,7 @@ } // Sync main player (only if we're viewing a video page AND the "hide and mute ads" fallback is inactive) - else if (event.data.indexOf('goodTube_syncMainPlayer_') !== -1 && window.location.href.indexOf('/watch?') !== -1 && !goodTube_fallback) { + else if (event.data.indexOf('goodTube_syncMainPlayer_') !== -1 && goodTube_helper_watchingVideo() && !goodTube_fallback) { // Parse the data let syncTime = parseFloat(event.data.replace('goodTube_syncMainPlayer_', '')); @@ -1670,7 +1701,7 @@ goodTube_getParams = goodTube_helper_setupGetParams(); // If we're viewing a video - if (window.location.href.indexOf('/watch?') !== -1) { + if (goodTube_helper_watchingVideo()) { // Load the video goodTube_player_load(); @@ -1688,7 +1719,7 @@ } // If we're viewing a video - if (window.location.href.indexOf('/watch?') !== -1) { + if (goodTube_helper_watchingVideo()) { // Show or hide the end screen (based on autoplay, not the setting) goodTube_nav_showHideEndScreen(); @@ -2488,7 +2519,7 @@ // Disable some shortcuts while the overlay is enabled function disableShortcuts(event) { // Make sure we're watching a video and the overlay state is disabled - if (window.location.href.indexOf('/watch?') === -1 || goodTube_hideAndMuteAds_state !== 'enabled') { + if (!goodTube_helper_watchingVideo() || goodTube_hideAndMuteAds_state !== 'enabled') { return; } @@ -2548,7 +2579,7 @@ let goodTube_hideAndMuteAdsFallback_check_timeout = setTimeout(() => {}, 0); function goodTube_hideAndMuteAdsFallback_check() { // If the "hide and mute ads" fallback is active AND we're viewing a video - if (goodTube_fallback && window.location.href.indexOf('/watch?') !== -1) { + if (goodTube_fallback && goodTube_helper_watchingVideo()) { // If ads are showing if (goodTube_adsShowing) { // Enable the "hide and mute ads" overlay @@ -2560,6 +2591,10 @@ goodTube_hideAndMuteAdsFallback_disable(); } } + // Otherwise reset the "hide and mute ads" state + else { + goodTube_hideAndMuteAds_state = ''; + } // Clear timeout first to solve memory leak issues clearTimeout(goodTube_hideAndMuteAdsFallback_check_timeout); @@ -2578,7 +2613,7 @@ } // Get the Youtube video element - let videoElement = document.querySelector('#player video'); + let videoElement = document.querySelector('#movie_player video'); // If we found the video element if (videoElement) { @@ -2636,7 +2671,7 @@ } // Play the video (this solves an edge case) - goodTube_hideAndMuteAdsFallback_play(); + goodTube_hideAndMuteAdsFallback_play(true); // Make sure we only do this once goodTube_hideAndMuteAds_state = 'enabled'; @@ -2650,23 +2685,23 @@ } // Get the Youtube video element - let videoElement = document.querySelector('#player video'); + let videoElement = document.querySelector('#movie_player video'); // If we found the video element if (videoElement) { // Restore the playback speed videoElement.playbackRate = goodTube_playbackSpeed; - // Restore the volume (only if muted, otherwise leave it alone) - if (videoElement.volume <= 0 || videoElement.muted) { - videoElement.muted = false; - videoElement.volume = 1; + // Get the page API + goodTube_page_api = document.getElementById('movie_player'); - // Get the page API - goodTube_page_api = document.getElementById('movie_player'); + // Make sure we have access to the functions we need + if (goodTube_page_api && typeof goodTube_page_api.unMute === 'function' && typeof goodTube_page_api.setVolume === 'function' && typeof goodTube_page_api.getVolume === 'function') { + // Restore the volume (only if muted, otherwise leave it alone) + if (videoElement.volume <= 0 || videoElement.muted || goodTube_page_api.getVolume() === 0) { + videoElement.muted = false; + videoElement.volume = 1; - // Make sure we have access to the functions we need - if (goodTube_page_api && typeof goodTube_page_api.unMute === 'function' && typeof goodTube_page_api.setVolume === 'function') { // Unmute and set the volume via the API (this is required, doing it via the