From 62cdc74b3a8d957b9270dcb0f7240dbf2c1f203d Mon Sep 17 00:00:00 2001 From: OwnedByWuigi Date: Mon, 2 Mar 2026 19:28:35 -0800 Subject: [PATCH] step 1 in trying to fix yeezy.com --- .../basilisk/branding/shared/uaoverrides.inc | 1 + image/decoders/nsWebPDecoder.cpp | 2 +- image/decoders/nsWebPDecoder.h | 2 +- netwerk/base/nsStandardURL.cpp | 19 +++++++++++++++++++ 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/application/basilisk/branding/shared/uaoverrides.inc b/application/basilisk/branding/shared/uaoverrides.inc index f7df63b82b..2ff85e69f8 100644 --- a/application/basilisk/branding/shared/uaoverrides.inc +++ b/application/basilisk/branding/shared/uaoverrides.inc @@ -73,6 +73,7 @@ pref("@GUAO_PREF@.web.whatsapp.com","Mozilla/5.0 (Windows NT 10.0; Win64; x64) A pref("@GUAO_PREF@.youtube.com","Mozilla/5.0 (%OS_SLICE%; Win64; x64; rv:147.0) Gecko/20100101 Firefox/147.0"); pref("@GUAO_PREF@.studio.youtube.com","Mozilla/5.0 (%OS_SLICE%; Win64; x64; rv:147.0) Gecko/20100101 Firefox/147.0"); pref("@GUAO_PREF@.gaming.youtube.com", "Mozilla/5.0 (%OS_SLICE%; Win64; x64; rv:147.0) Gecko/20100101 Firefox/147.0"); +pref("@GUAO_PREF@.yeezy.com", "Mozilla/5.0 (%OS_SLICE%; Win64; x64; rv:52.0) Gecko/20100101 Firefox/52.0"); // The following domains do not like the Goanna slice pref("@GUAO_PREF@.bab.la","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@"); diff --git a/image/decoders/nsWebPDecoder.cpp b/image/decoders/nsWebPDecoder.cpp index 3181e3a3ad..219bb377d6 100644 --- a/image/decoders/nsWebPDecoder.cpp +++ b/image/decoders/nsWebPDecoder.cpp @@ -590,4 +590,4 @@ nsWebPDecoder::ReadMultiple(WebPDemuxer* aDemuxer, bool aIsComplete) } } // namespace image -} // namespace mozilla +} // namespace mozilla \ No newline at end of file diff --git a/image/decoders/nsWebPDecoder.h b/image/decoders/nsWebPDecoder.h index 21df5279b6..9938f64bd6 100644 --- a/image/decoders/nsWebPDecoder.h +++ b/image/decoders/nsWebPDecoder.h @@ -108,4 +108,4 @@ private: } // namespace image } // namespace mozilla -#endif // mozilla_image_decoders_nsWebPDecoder_h +#endif // mozilla_image_decoders_nsWebPDecoder_h \ No newline at end of file diff --git a/netwerk/base/nsStandardURL.cpp b/netwerk/base/nsStandardURL.cpp index 9334def6c7..73ec694d1d 100644 --- a/netwerk/base/nsStandardURL.cpp +++ b/netwerk/base/nsStandardURL.cpp @@ -1105,6 +1105,25 @@ nsStandardURL::ParseURL(const char *spec, int32_t specLen) nsresult nsStandardURL::ParsePath(const char *spec, uint32_t pathPos, int32_t pathLen) { +// Cloudflare Image Resizing compatibility: +// Treat everything after /cdn-cgi/image/ as opaque path data. +nsDependentCSubstring fullPath(spec + pathPos, pathLen); + +nsACString::const_iterator begin, end; +fullPath.BeginReading(begin); +fullPath.EndReading(end); + +nsACString::const_iterator cfPos = begin; +if (FindInReadable(NS_LITERAL_CSTRING("/cdn-cgi/image/"), cfPos, end)) { + uint32_t offset = cfPos.get() - begin.get(); + + mPath.mPos = pathPos + offset; + mPath.mLen = pathLen - offset; + + return NS_OK; +} + + LOG(("ParsePath: %s pathpos %d len %d\n",spec,pathPos,pathLen)); if (pathLen > net_GetURLMaxLength()) {