From ace2c1c1eea388a0cbfa2171a83d43b1d884b364 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Thu, 31 Jul 2025 01:41:33 +0200 Subject: [PATCH] [DOM] Simplify `` 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). --- dom/base/nsObjectLoadingContent.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/dom/base/nsObjectLoadingContent.cpp b/dom/base/nsObjectLoadingContent.cpp index aa179eba88..272d3c1de6 100644 --- a/dom/base/nsObjectLoadingContent.cpp +++ b/dom/base/nsObjectLoadingContent.cpp @@ -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 tempURI = mURI; - nsCOMPtr 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) {