Move adblock workaround into a toggle

This commit is contained in:
Bryce Hackel 2024-04-29 16:28:37 -07:00
parent ccb87ba2d7
commit 1fc75eb459
No known key found for this signature in database
GPG key ID: F031960F08455E88
2 changed files with 9 additions and 2 deletions

View file

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

View file

@ -1002,6 +1002,7 @@ YTSettingsSectionItem *lowContrastModeButton = [%c(YTSettingsSectionItem)
# pragma mark - Miscellaneous # pragma mark - Miscellaneous
SECTION_HEADER(LOC(@"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_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(@"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"); SWITCH_ITEM(LOC(@"Hide YouTube Logo"), LOC(@"Toggle this to hide the YouTube Logo in the YouTube App."), @"hideYouTubeLogo_enabled");