Allow loading local file URIs when schemas don't match.

Internet Explorer allows loading file:// URIs when the schemas don't match
(for example, from a https website), and some applications, such as the
launcher for Imperiums: Greek Wars, depends on this as it loads the news
feed via http and then puts CSS with the background from the game directory
via file://

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
This commit is contained in:
Gabriel Ivăncescu 2022-07-03 20:10:37 +03:00 committed by Jacek Caban
parent 57f5269bfc
commit ebc2b46a8b

View File

@ -933,6 +933,14 @@ nsScriptSecurityManager::CheckLoadURIWithPrincipal(nsIPrincipal* aPrincipal,
return NS_OK;
}
#ifdef WINE_GECKO_SRC
// Internet Explorer allows loading file:// URIs from other schemes...
if (!(aFlags & (nsIScriptSecurityManager::DISALLOW_INHERIT_PRINCIPAL |
nsIScriptSecurityManager::DISALLOW_SCRIPT |
nsIScriptSecurityManager::LOAD_IS_AUTOMATIC_DOCUMENT_REPLACEMENT)))
return NS_OK;
#endif
// Nothing else.
if (reportErrors) {
ReportError(nullptr, errorTag, sourceURI, aTargetURI);