#525: workaround for old addons, uBlock origin

This commit is contained in:
Cameron Kaiser 2018-10-30 21:01:33 -07:00
parent f059d57c07
commit f898ad6430
3 changed files with 27 additions and 2 deletions

View File

@ -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;

View File

@ -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.

View File

@ -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();
}
}