Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion packages/compass/src/setup-hadron-distribution.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import path from 'path';
import { app } from 'electron';
import { app, protocol, net } from 'electron';

/**
* All these variables below are used by Compass and its plugins in one way or
Expand Down Expand Up @@ -54,6 +54,16 @@ if (
// seemingly nothing is using this path anyway, we probably can ignore an
// error here
app.setPath('userCache', path.join(app.getPath('cache'), app.getName()));

// TODO(COMPASS-8269): even with `webSecurity` disabled for local dev,
// file:// requests for shell worker are silently getting canceled by the
// browser, adding explicit protocol handler for it that just does the same
// request using electron network stack works around the issue
void app.whenReady().then(() => {
protocol.handle('file', (req) => {
return net.fetch(req, { bypassCustomProtocolHandlers: true });
});
});
}

app.setPath(
Expand Down
Loading