diff --git a/browser/base/content/test/performance/PerfTestHelpers.jsm b/browser/base/content/test/performance/PerfTestHelpers.jsm index bf5a1543f7ab..fd22a3aa6258 100644 --- a/browser/base/content/test/performance/PerfTestHelpers.jsm +++ b/browser/base/content/test/performance/PerfTestHelpers.jsm @@ -50,6 +50,9 @@ var PerfTestHelpers = { let channel = lazy.NetUtil.newChannel({ uri, loadUsingSystemPrincipal: true, + // Avoid crashing for non-existant files. If the file not existing + // is bad, we can deal with it in the test instead. + contentPolicyType: Ci.nsIContentPolicy.TYPE_FETCH, }); channel.asyncOpen({ diff --git a/modules/libjar/nsJARChannel.cpp b/modules/libjar/nsJARChannel.cpp index 6d8b9e4473a0..8e3a057cc4b7 100644 --- a/modules/libjar/nsJARChannel.cpp +++ b/modules/libjar/nsJARChannel.cpp @@ -286,9 +286,6 @@ nsresult nsJARChannel::CreateJarInput(nsIZipReaderCache* jarCache, new nsJARInputThunk(reader, mJarURI, mJarEntry, jarCache != nullptr); rv = input->Init(); if (NS_FAILED(rv)) { - if (rv == NS_ERROR_FILE_NOT_FOUND) { - CheckForBrokenChromeURL(mLoadInfo, mOriginalURI); - } return rv; } @@ -488,6 +485,9 @@ nsresult nsJARChannel::OnOpenLocalFileComplete(nsresult aResult, MOZ_ASSERT(mIsPending); if (NS_FAILED(aResult)) { + if (aResult == NS_ERROR_FILE_NOT_FOUND) { + CheckForBrokenChromeURL(mLoadInfo, mOriginalURI); + } if (!aIsSyncCall) { NotifyError(aResult); } diff --git a/netwerk/base/nsNetUtil.cpp b/netwerk/base/nsNetUtil.cpp index fcb887140094..bdad496d2e70 100644 --- a/netwerk/base/nsNetUtil.cpp +++ b/netwerk/base/nsNetUtil.cpp @@ -3864,6 +3864,20 @@ void CheckForBrokenChromeURL(nsILoadInfo* aLoadInfo, nsIURI* aURI) { nsCString spec; aURI->GetSpec(spec); +#ifdef ANDROID + // Various toolkit files use this and are shipped on android, but + // info-pages.css and aboutLicense.css are not - bug 1808987 + if (StringEndsWith(spec, "info-pages.css"_ns) || + StringEndsWith(spec, "aboutLicense.css"_ns) || + // Error page CSS is also missing: bug 1810039 + StringEndsWith(spec, "aboutNetError.css"_ns) || + StringEndsWith(spec, "error-pages.css"_ns) || + // Used by an extension installation test - bug 1809650 + StringBeginsWith(spec, "resource://android/assets/web_extensions/"_ns)) { + return; + } +#endif + // DTD files from gre may not exist when requested by tests. if (StringBeginsWith(spec, "resource://gre/res/dtd/"_ns)) { return;