[DOM] Simplify <object> scheme check code and fix plugin handling.

Trying to do a positive check on nested URIs apparently doesn't work,
but the handling could be simplified to just check for non-null mURI
instead - this also fixes plugin loading (which broke with the previous
check).
This commit is contained in:
Moonchild 2025-07-31 01:41:33 +02:00 committed by roytam1
commit ace2c1c1ee

View file

@ -2328,17 +2328,13 @@ nsObjectLoadingContent::LoadObject(bool aNotify,
// "about", "blob", "data", "file", "http", "https".
//
// Some accessibility tests use our internal "chrome" scheme.
if (mType != eType_Null) {
nsCOMPtr<nsIURI> tempURI = mURI;
nsCOMPtr<nsINestedURI> nestedURI = do_QueryInterface(tempURI);
if (mType != eType_Null && mURI) {
bool isCandidate = false;
if (nestedURI) {
for (const auto& candidate :
{"about", "blob", "chrome", "data", "file", "http", "https"}) {
rv = tempURI->SchemeIs(candidate, &isCandidate);
if (NS_SUCCEEDED(rv) && isCandidate) {
break;
}
for (const auto& candidate :
{"about", "blob", "chrome", "data", "file", "http", "https"}) {
rv = mURI->SchemeIs(candidate, &isCandidate);
if (NS_SUCCEEDED(rv) && isCandidate) {
break;
}
}
if (!isCandidate) {