Skip to content

Fix mobile video pages redirecting to homepage#630

Open
scarf005 wants to merge 1 commit intoamitbl:masterfrom
scarf005:fix-mobile-redirect-629
Open

Fix mobile video pages redirecting to homepage#630
scarf005 wants to merge 1 commit intoamitbl:masterfrom
scarf005:fix-mobile-redirect-629

Conversation

@scarf005
Copy link
Copy Markdown

@scarf005 scarf005 commented Feb 3, 2026

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 a customFunc for slimVideoMetadataSectionRenderer, 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:

  • Have their content deleted if autoplay was disabled
  • Redirect to another video if autoplay was enabled

Fix

Added 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.

function redirectToNextMobile() {
  if (!currentBlock) {
    return false;
  }
  // ... rest of redirect logic
}

This matches the pattern used elsewhere in the codebase where currentBlock is checked before executing redirect logic (e.g., line 1097 in fetchFilter()).

Testing

  • No syntax errors or diagnostics
  • Minimal change (4 lines added)
  • Preserves existing behavior for blocked videos
  • Fixes the issue for non-blocked videos on mobile

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
@scarf005 scarf005 changed the title Fix mobile video pages redirecting to homepage (#629) Fix mobile video pages redirecting to homepage Feb 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

page redirects to home on android

1 participant