Merge remote-tracking branch 'origin/tracking' into custom

This commit is contained in:
roytam1 2025-07-31 22:08:44 +08:00
commit 3553319265

View file

@ -2328,19 +2328,15 @@ nsObjectLoadingContent::LoadObject(bool aNotify,
// "about", "blob", "data", "file", "http", "https". // "about", "blob", "data", "file", "http", "https".
// //
// Some accessibility tests use our internal "chrome" scheme. // Some accessibility tests use our internal "chrome" scheme.
if (mType != eType_Null) { if (mType != eType_Null && mURI) {
nsCOMPtr<nsIURI> tempURI = mURI;
nsCOMPtr<nsINestedURI> nestedURI = do_QueryInterface(tempURI);
bool isCandidate = false; bool isCandidate = false;
if (nestedURI) {
for (const auto& candidate : for (const auto& candidate :
{"about", "blob", "chrome", "data", "file", "http", "https"}) { {"about", "blob", "chrome", "data", "file", "http", "https"}) {
rv = tempURI->SchemeIs(candidate, &isCandidate); rv = mURI->SchemeIs(candidate, &isCandidate);
if (NS_SUCCEEDED(rv) && isCandidate) { if (NS_SUCCEEDED(rv) && isCandidate) {
break; break;
} }
} }
}
if (!isCandidate) { if (!isCandidate) {
LOG(("OBJLC [%p]: Blocking as effective URI does not have an allowed scheme", LOG(("OBJLC [%p]: Blocking as effective URI does not have an allowed scheme",
this)); this));