Fix mobile video pages redirecting to homepage#630
Open
scarf005 wants to merge 1 commit intoamitbl:masterfrom
Open
Fix mobile video pages redirecting to homepage#630scarf005 wants to merge 1 commit intoamitbl:masterfrom
scarf005 wants to merge 1 commit intoamitbl:masterfrom
Conversation
The redirectToNextMobile() function was being called on every mobile video page as part of processing slimVideoMetadataSectionRenderer. However, it was not checking whether a video was actually blocked before executing redirect/delete logic. This caused ALL videos on mobile (m.youtube.com) to either: - Have their content deleted if autoplay was disabled - Redirect to another video if autoplay was enabled The fix adds a check at the start of redirectToNextMobile() to return early if currentBlock is false, ensuring the function only acts when a video has actually been blocked by the filter. Fixes amitbl#629
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #629 - Video pages were redirecting to the homepage on all Android/mobile devices when BlockTube was active.
Root Cause
The
redirectToNextMobile()function is configured as acustomFuncforslimVideoMetadataSectionRenderer, which appears on every mobile video page. The function was being called for ALL videos but wasn't checking whether a video was actually blocked before executing its redirect/delete logic.This caused ALL videos on mobile (
m.youtube.com) to either:Fix
Added a check at the start of
redirectToNextMobile()to return early ifcurrentBlockis false, ensuring the function only acts when a video has actually been blocked by the filter.This matches the pattern used elsewhere in the codebase where
currentBlockis checked before executing redirect logic (e.g., line 1097 infetchFilter()).Testing