From c51a503edbd1221e9300ad549659cfd77a5a0cb4 Mon Sep 17 00:00:00 2001 From: Cameron Kaiser Date: Wed, 19 Apr 2023 22:09:57 -0700 Subject: [PATCH] #659 sidecar: better blocking means for developer.mozilla.org --- caps/nsScriptSecurityManager.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/caps/nsScriptSecurityManager.cpp b/caps/nsScriptSecurityManager.cpp index 3e7450314..51cf055f1 100644 --- a/caps/nsScriptSecurityManager.cpp +++ b/caps/nsScriptSecurityManager.cpp @@ -699,6 +699,7 @@ nsScriptSecurityManager::CheckLoadURIWithPrincipal(nsIPrincipal* aPrincipal, ToLowerCase(hostname); #define BLOC(q) hostname.EqualsLiteral(q) #define BLOCU(q) url.EqualsLiteral(q) +#define BLOCS(q) (StringBeginsWith(url, NS_LITERAL_CSTRING(q))) #define BLOCE(q) (StringEndsWith(url, NS_LITERAL_CSTRING(q))) if (0 || @@ -711,11 +712,12 @@ nsScriptSecurityManager::CheckLoadURIWithPrincipal(nsIPrincipal* aPrincipal, BLOCE("/public/scripts/tldr/index.js") ) || #endif // __ppc__ - BLOCU("https://developer.mozilla.org/static/js/main.7780a43b.js") || + BLOCS("https://developer.mozilla.org/static/js/main.") || 0) { #undef BLOC #undef BLOCU +#undef BLOCS #undef BLOCE #ifndef DEBUG