diff --git a/brave/browser/brave_content_browser_client.cc b/brave/browser/brave_content_browser_client.cc index a21a39eb8..f47ae6336 100644 --- a/brave/browser/brave_content_browser_client.cc +++ b/brave/browser/brave_content_browser_client.cc @@ -824,6 +824,21 @@ bool BraveContentBrowserClient::ShouldUseSpareRenderProcessHost( #endif } +const char* +BraveContentBrowserClient::GetInitatorSchemeBypassingDocumentBlocking() { +#if BUILDFLAG(ENABLE_EXTENSIONS) + // Don't block responses for extension processes or for content scripts. + // TODO(creis): When every extension fetch (including content scripts) has + // been made to go through an extension-specific URLLoaderFactory, this + // mechanism ought to work by enumerating the host permissions from the + // extension manifest, and forwarding them on to the network service while + // brokering the URLLoaderFactory. + return extensions::kExtensionScheme; +#else + return nullptr; +#endif +} + void BraveContentBrowserClient::GetAdditionalAllowedSchemesForFileSystem( std::vector* additional_allowed_schemes) { AtomBrowserClient::GetAdditionalAllowedSchemesForFileSystem( diff --git a/brave/browser/brave_content_browser_client.h b/brave/browser/brave_content_browser_client.h index 64f491cfd..6ab81e4ff 100644 --- a/brave/browser/brave_content_browser_client.h +++ b/brave/browser/brave_content_browser_client.h @@ -114,6 +114,7 @@ class BraveContentBrowserClient : public atom::AtomBrowserClient { content::BrowserContext* browser_context, const GURL& url) override; + const char* GetInitatorSchemeBypassingDocumentBlocking() override; void GetAdditionalAllowedSchemesForFileSystem( std::vector* additional_allowed_schemes) override; void GetAdditionalWebUISchemes(