Improve patch for sponsor banner. (#541)

This commit is contained in:
Etorix 2025-12-06 12:53:51 -08:00 • committed by GitHub
parent 4f23a0449e
commit 09a9ebd409
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -967,11 +967,18 @@ export default definePlugin({
},
{
// Hides the sponsored banner on the Quests page.
find: "assetSponsorImage.url,",
replacement: {
match: /(?<=campaignId]\),)/,
replace: "$self.shouldHideSponsoredQuestBanner()?null:"
}
find: "{isInDiscoverQuestHomeTab:",
group: true,
replacement: [
{
match: /(?<=resetSortingFiltering\(\)},\[\]\);)/,
replace: "const shouldHideSponsoredQuestBanner=$self.shouldHideSponsoredQuestBanner();"
},
{
match: /(?<=if\(null!=\i\))return(.{0,60}?}\))/,
replace: "if(!shouldHideSponsoredQuestBanner)return $1"
}
]
},
{
// Hides the Quest icon from members list items when