Skip to content
This repository has been archived by the owner on Oct 26, 2024. It is now read-only.

Commit

Permalink
fix(YouTube - Hide Shorts components): Hide subscribe button in chann…
Browse files Browse the repository at this point in the history
…el bar
  • Loading branch information
LisoUseInAIKyrios committed Apr 17, 2024
1 parent d60dcf9 commit 9938bbf
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@
@SuppressWarnings("unused")
public final class ShortsFilter extends Filter {
public static PivotBar pivotBar; // Set by patch.
private final String REEL_CHANNEL_BAR_PATH = "reel_channel_bar.eml";

private final static String REEL_CHANNEL_BAR_PATH = "reel_channel_bar.eml";
/**
* For subscribe button that appears in the channel bar.
*/
private final static String REEL_METAPANEL_PATH = "reel_metapanel.eml";

private final StringFilterGroup shortsCompactFeedVideoPath;
private final ByteArrayFilterGroup shortsCompactFeedVideoBuffer;
Expand Down Expand Up @@ -192,8 +197,8 @@ boolean isFiltered(@Nullable String identifier, String path, byte[] protobufBuff
StringFilterGroup matchedGroup, FilterContentType contentType, int contentIndex) {
if (contentType == FilterContentType.PATH) {
if (matchedGroup == subscribeButton || matchedGroup == joinButton) {
// Filter only when reelChannelBar is visible to avoid false positives.
if (path.startsWith(REEL_CHANNEL_BAR_PATH)) {
// Selectively filter to avoid false positive filtering of other subscribe/join buttons.
if (path.startsWith(REEL_CHANNEL_BAR_PATH) || path.startsWith(REEL_METAPANEL_PATH)) {
return super.isFiltered(
identifier, path, protobufBufferArray, matchedGroup, contentType, contentIndex
);
Expand Down

0 comments on commit 9938bbf

Please sign in to comment.