Merge pull request #576 from bhackel/split-adblocking

Move adblock workaround into a toggle
This commit is contained in:
arichornlover 2024-04-29 19:05:07 -05:00 committed by GitHub
commit 524c694770
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 2 deletions

View file

@ -86,7 +86,7 @@ static int contrastMode() {
}
%end
/*
%group uYouAdBlockingWorkaround
// Workaround: uYou 3.0.3 Adblock fix - @PoomSmart
%hook YTAdsInnerTubeContextDecorator
- (void)decorateContext:(id)context {
@ -151,7 +151,7 @@ BOOL isAd(YTIElementRenderer *self) {
%orig;
}
%end
*/
%end
// Hide YouTube Logo - @dayanch96
%group gHideYouTubeLogo
@ -1487,6 +1487,9 @@ static BOOL findCell(ASNodeController *nodeController, NSArray <NSString *> *ide
if (IS_ENABLED(@"disablePullToFull_enabled")) {
%init(gDisablePullToFull);
}
if (IS_ENABLED(@"uYouAdBlockingWorkaround_enabled")) {
%init(uYouAdBlockingWorkaround);
}
// YTNoModernUI - @arichorn
BOOL ytNoModernUIEnabled = IS_ENABLED(@"ytNoModernUI_enabled");
@ -1524,6 +1527,9 @@ static BOOL findCell(ASNodeController *nodeController, NSArray <NSString *> *ide
if (![allKeys containsObject:@"YouPiPEnabled"]) {
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"YouPiPEnabled"];
}
if (![allKeys containsObject:@"uYouAdBlockingWorkaround_enabled"]) {
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"uYouAdBlockingWorkaround_enabled"];
}
// Broken uYou 3.0.3 setting: No Suggested Videos at The Video End
// Set default to allow autoplay, user can disable later
if (![allKeys containsObject:@"noSuggestedVideoAtEnd"]) {

View file

@ -1002,6 +1002,7 @@ YTSettingsSectionItem *lowContrastModeButton = [%c(YTSettingsSectionItem)
# pragma mark - Miscellaneous
SECTION_HEADER(LOC(@"MISCELLANEOUS"));
SWITCH_ITEM2(LOC(@"Adblock Workaround"), LOC(@"Uses stronger adblocking code. Can cause blank spots on homepage"), @"uYouAdBlockingWorkaround_enabled");
SWITCH_ITEM2(LOC(@"Fake Premium"), LOC(@"Uses Premium logo and creates fake buttons in the You tab"), @"youTabFakePremium_enabled");
// SWITCH_ITEM(LOC(@"Center YouTube Logo"), LOC(@"Toggle this to move the official YouTube Logo to the Center. App restart is required."), @"centerYouTubeLogo_enabled");
SWITCH_ITEM(LOC(@"Hide YouTube Logo"), LOC(@"Toggle this to hide the YouTube Logo in the YouTube App."), @"hideYouTubeLogo_enabled");