Skip to content

Commit e550737

Browse files
committed
Disable Electron on Mac entirely, reverting part of 43a449a
Unfortunately our quick workaround depends on prompt(), which isn't actually available in Electron regardless, so it doesn't work their either. This is tricky, we aren't going to find a pleasant quick fix, and it's currently breaking things in weird ways for every Mac user that tries it. Best to explicitly disable it as unsupported instead.
1 parent 427f28c commit e550737

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

src/components/intercept/config/electron-config.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,13 +142,7 @@ class ElectronConfig extends React.Component<{
142142
}
143143

144144
selectApplication = async () => {
145-
const pathToApplication = platform == 'mac'
146-
? window.prompt(
147-
// Mac Electron doesn't allow file pickers inside .app bundles, and does very weird things
148-
// if you select the whole bundle, scanning everything within, so we require manual entry:
149-
"Please enter the path to the Electron application:"
150-
)
151-
: await uploadFile('path');
145+
const pathToApplication = await uploadFile('path');
152146

153147
if (!pathToApplication) {
154148
this.props.closeSelf();

src/model/interception/interceptors.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,10 +272,9 @@ const INTERCEPT_OPTIONS: _.Dictionary<InterceptorConfig> = {
272272
description: ["Launch an Electron application with all its traffic intercepted"],
273273
iconProps: SourceIcons.Electron,
274274
uiConfig: ElectronCustomUi,
275-
checkRequirements: ({ serverVersion, interceptorVersion }) => {
276-
return navigator.platform.startsWith('Mac')
277-
? versionSatisfies(serverVersion, '^1.10.1')
278-
: versionSatisfies(interceptorVersion, "^1.0.1")
275+
checkRequirements: ({ interceptorVersion }) => {
276+
return !navigator.platform.startsWith('Mac') &&
277+
versionSatisfies(interceptorVersion, "^1.0.1")
279278
},
280279
tags: ['electron', 'desktop', 'postman']
281280
},

0 commit comments

Comments
 (0)