diff --git a/dom/security/nsMixedContentBlocker.cpp b/dom/security/nsMixedContentBlocker.cpp index 7cfaf4dc333b..78fd657dc251 100644 --- a/dom/security/nsMixedContentBlocker.cpp +++ b/dom/security/nsMixedContentBlocker.cpp @@ -666,8 +666,8 @@ nsresult nsMixedContentBlocker::ShouldLoad(bool aHadInsecureImageRedirect, return NS_OK; } - // Check the parent scheme and window. If it is not an HTTPS page and not a - // secure context then mixed content restrictions do not apply. + // Check the parent scheme. If it is not an HTTPS page then mixed content + // restrictions do not apply. nsCOMPtr innerRequestingLocation = NS_GetInnermostURI(requestingLocation); if (!innerRequestingLocation) { @@ -681,11 +681,7 @@ nsresult nsMixedContentBlocker::ShouldLoad(bool aHadInsecureImageRedirect, } bool parentIsHttps = innerRequestingLocation->SchemeIs("https"); - bool parentIsSecureContext = - requestingWindow && requestingWindow->GetIsSecureContext(); - // Extensions are exempt from mixed content restrictions. - bool parentIsExtension = innerRequestingLocation->SchemeIs("moz-extension"); - if ((!parentIsHttps && !parentIsSecureContext) || parentIsExtension) { + if (!parentIsHttps) { *aDecision = ACCEPT; MOZ_LOG(sMCBLog, LogLevel::Verbose, (" -> decision: Request will be allowed because the requesting " diff --git a/dom/security/test/mixedcontentblocker/file_bug1474842.html b/dom/security/test/mixedcontentblocker/file_bug1474842.html deleted file mode 100644 index 7bba4c03ea25..000000000000 --- a/dom/security/test/mixedcontentblocker/file_bug1474842.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/dom/security/test/mixedcontentblocker/file_bug1474842.js b/dom/security/test/mixedcontentblocker/file_bug1474842.js deleted file mode 100644 index 609c2eb6cf41..000000000000 --- a/dom/security/test/mixedcontentblocker/file_bug1474842.js +++ /dev/null @@ -1 +0,0 @@ -console.log("i should not be loaded"); diff --git a/dom/security/test/mixedcontentblocker/mochitest.ini b/dom/security/test/mixedcontentblocker/mochitest.ini index 37bf4537c135..56bac265aa70 100644 --- a/dom/security/test/mixedcontentblocker/mochitest.ini +++ b/dom/security/test/mixedcontentblocker/mochitest.ini @@ -21,8 +21,6 @@ support-files = file_redirect.html file_redirect_handler.sjs file_bug1551886.html - file_bug1474842.html - file_bug1474842.js [test_main.html] skip-if = @@ -35,5 +33,3 @@ skip-if = webrender # Bug 1424752 [test_redirect.html] [test_bug1551886.html] -[test_bug1474842.html] -scheme = https diff --git a/dom/security/test/mixedcontentblocker/test_bug1474842.html b/dom/security/test/mixedcontentblocker/test_bug1474842.html deleted file mode 100644 index 10502b9f6ce5..000000000000 --- a/dom/security/test/mixedcontentblocker/test_bug1474842.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - Bug 1474842: mixed content blocker bypass for localhost pages in iframe - - - - - - - - diff --git a/toolkit/components/extensions/test/xpcshell/data/file_do_load_script_subresource.html b/toolkit/components/extensions/test/xpcshell/data/file_do_load_script_subresource.html index bb6dc5b5ce93..c74dec5f5acc 100644 --- a/toolkit/components/extensions/test/xpcshell/data/file_do_load_script_subresource.html +++ b/toolkit/components/extensions/test/xpcshell/data/file_do_load_script_subresource.html @@ -4,6 +4,6 @@ - + diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_file_access.js b/toolkit/components/extensions/test/xpcshell/test_ext_file_access.js index 6454a00b0d25..c05188cd3822 100644 --- a/toolkit/components/extensions/test/xpcshell/test_ext_file_access.js +++ b/toolkit/components/extensions/test/xpcshell/test_ext_file_access.js @@ -165,7 +165,7 @@ add_task(async function webRequest_script_request_from_file_principals() { redirectUrl: `data:text/javascript,location.href='${redirectUrl}';`, }; }, - { urls: ["https://example.net/intercept_by_webRequest.js"] }, + { urls: ["http://example.net/intercept_by_webRequest.js"] }, ["blocking"] ); },