Skip to content

Commit

Permalink
Revert "fix: service worker registration with custom protocols (elect…
Browse files Browse the repository at this point in the history
…ron#34290)"

This reverts commit 1639ccf.

# Conflicts:
#	patches/chromium/custom_protocols_plzserviceworker.patch
  • Loading branch information
yurii.lozytskyi committed Sep 25, 2022
1 parent a69cca0 commit 315d16a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 59 deletions.
53 changes: 0 additions & 53 deletions patches/chromium/custom_protocols_plzserviceworker.patch

This file was deleted.

5 changes: 0 additions & 5 deletions shell/browser/electron_browser_client.cc
Expand Up @@ -1389,11 +1389,6 @@ void ElectronBrowserClient::
DCHECK(browser_context);
DCHECK(factories);

auto* protocol_registry =
ProtocolRegistry::FromBrowserContext(browser_context);
protocol_registry->RegisterURLLoaderFactories(factories,
false /* allow_file_access */);

#if BUILDFLAG(ENABLE_EXTENSIONS)
factories->emplace(
extensions::kExtensionScheme,
Expand Down
5 changes: 4 additions & 1 deletion spec/api-protocol-spec.ts
Expand Up @@ -785,7 +785,10 @@ describe('protocol module', () => {
await expect(contents.executeJavaScript(`navigator.serviceWorker.register('${v4()}.notjs', {scope: './'})`)).to.be.rejected();
});

it('should be able to register service worker for custom scheme', async () => {
// TODO(nornagon): I'm not sure why this isn't working, but I'm choosing to
// disable this test for now to land the roll. See
// https://github.com/electron/electron/issues/32664.
it.skip('should be able to register service worker for custom scheme', async () => {
await contents.loadURL(`${serviceWorkerScheme}://${v4()}.com`);
await contents.executeJavaScript(`navigator.serviceWorker.register('${v4()}.js', {scope: './'})`);
});
Expand Down

0 comments on commit 315d16a

Please sign in to comment.