fix: loading dedicated/shared worker scripts over custom protocol (#20625)

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
Robo 2020-07-27 18:48:37 -07:00 committed by GitHub
parent 4829b0f816
commit 76e3ee6fe6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 136 additions and 5 deletions

View file

@ -1263,6 +1263,16 @@ void ElectronBrowserClient::RegisterNonNetworkNavigationURLLoaderFactories(
URLLoaderFactoryType::kNavigation, factories);
}
void ElectronBrowserClient::
RegisterNonNetworkWorkerMainResourceURLLoaderFactories(
content::BrowserContext* browser_context,
NonNetworkURLLoaderFactoryMap* factories) {
auto* protocol_registry =
ProtocolRegistry::FromBrowserContext(browser_context);
protocol_registry->RegisterURLLoaderFactories(
URLLoaderFactoryType::kWorkerMainResource, factories);
}
#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
namespace {