diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index 9cc2a9fb2..d01e9053f 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -10591,6 +10591,25 @@ nsDocShell::DoURILoad(nsIURI* aURI, triggeringPrincipal = nsContentUtils::GetSystemPrincipal(); } + if (!inherit) { + // We can confidently assume this is a channel that does not inherit + // the principal, and thus does not have flags on the protocol that + // ask for it. If the load is for a data: URI, inherit the principal if + // the system principal initiated the load to maintain compatibility + // with addons, but warn the user as a penalty (TenFourFox issue 525). + bool isData = false; + rv = aURI->SchemeIs("data", &isData); + if (NS_SUCCEEDED(rv) && isData) { + if (nsContentUtils::IsSystemPrincipal(triggeringPrincipal)) { + fprintf(stderr, +"Warning: TenFourFox enabling inherited principal for data: URI from system.\n" +"Warning: Make sure you are using a minimum set of up-to-date addons.\n" + ); + inherit = true; + } + } + } + nsSecurityFlags securityFlags = nsILoadInfo::SEC_NORMAL; if (inherit) { securityFlags |= nsILoadInfo::SEC_FORCE_INHERIT_PRINCIPAL; diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index 6156e1f33..c6bcbe9d5 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -2008,8 +2008,8 @@ pref("security.cert_pinning.process_headers_from_non_builtin_roots", false); // a NullPrincipal as the security context. // Otherwise it will inherit the origin from parent node, this is the legacy // behavior of Firefox. -// TenFourFox issue 525 -- hold until better chrome detection is working -pref("security.data_uri.unique_opaque_origin", false); +// See also TenFourFox issue 525 for a workaround for old-style addons. +pref("security.data_uri.unique_opaque_origin", true); // Modifier key prefs: default to Windows settings, // menu access key = alt, accelerator key = control. diff --git a/storage/mozStorageService.cpp b/storage/mozStorageService.cpp index 7a7b1e5b9..811e49340 100644 --- a/storage/mozStorageService.cpp +++ b/storage/mozStorageService.cpp @@ -975,6 +975,12 @@ Service::Observe(nsISupports *, const char *aTopic, const char16_t *) getConnections(connections); for (uint32_t i = 0, n = connections.Length(); i < n; i++) { if (!connections[i]->isClosed()) { + // This seems to happen with uBlock origin ... + fprintf(stderr, "FATAL ERROR: Storage connections not closed! Bad add-on! %s:%i\n", __FILE__, __LINE__); +#if __ppc__ + // Drop into the debugger. + __asm__("trap\n"); +#endif MOZ_CRASH(); } }