Hide search ads by @PoomSmart

This commit is contained in:
qnblackcat 2022-12-12 09:28:11 +07:00
parent 1150659ea1
commit 881d6292aa

View file

@ -21,6 +21,7 @@
#import "Tweaks/YouTubeHeader/YTReelPlayerBottomButton.h"
#import "Tweaks/YouTubeHeader/YTReelPlayerViewController.h"
#import "Tweaks/YouTubeHeader/YTAlertView.h"
#import "Tweaks/YouTubeHeader/YTIElementRenderer.h"
// Tweak's bundle for Localizations support - @PoomSmart - https://github.com/PoomSmart/YouPiP/commit/aea2473f64c75d73cab713e1e2d5d0a77675024f
NSBundle *uYouPlusBundle() {
@ -208,6 +209,29 @@ BOOL dontEatMyContent() {
}
%end
// Hide search ads by @PoomSmart - https://github.com/PoomSmart/YouTube-X
BOOL didLateHook = NO;
%group LateHook
%hook YTIElementRenderer
- (NSData *)elementData {
if (self.hasCompatibilityOptions && self.compatibilityOptions.hasAdLoggingData)
return nil;
return %orig;
}
%end
%end
%hook YTSectionListViewController
- (void)loadWithModel:(id)model {
if (!didLateHook) {
%init(LateHook);
didLateHook = YES;
}
%orig;
}
%end
// Workaround for https://github.com/MiRO92/uYou-for-YouTube/issues/94
%hook UIResponder
%new