-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Make Electron apps available on macOS again #80
Fix: Make Electron apps available on macOS again #80
Conversation
`window.nativeFile` is only defined when running in the desktop shell and the version of the desktop shell is recent enough to provide that property.
The change is meant for macOS
@pimterry I addressed the issues regarding the wrong type of Now I see two more aspects:
Use the native file open dialog in
|
For .app bundles, enter either the bundle name (with or without .app) | |
or the full path to the executable itself, typically stored in | |
Contents/MacOS inside the bundle. |
I have three ideas for this:
- Shorten the text to
For .app bundles select the executable itself, typically stored in Contents/MacOS inside the bundle.
. - Leave it as it is for now.
- Leave the text mostly and also enable the selection of directories, so that the app bundle itself can also again be selected, by adding
'openDirectory'
to https://github.com/httptoolkit/httptoolkit-desktop/pull/60/files#diff-a2a171449d862fe29692ce031981047d7ab755ae7f84c707aef80701b3ea0c80R593
I prefer 1.
What do you think?
Thanks for those fixes @datenreisender.
This is worth clarifying, because that's not quite right. The problem is that if you don't enable It does that by searching within the entire app package automatically, which is very slow and freezes everything for a while, and usually picks the wrong file at the end anyway. That all happened before we even received the selected file, so there was nothing we could do about this. If the .app is actually selected as a directory though (i.e. so the server receives "/Applications/abc.app" as the target to intercept) then it's all fine and everything will work great. The logic powering that is here (then called here) - it just reads the .app bundle metadata to get the binary path, and then runs that instead. This is a good point though, because it highlights that we're not currently supporting that here, but as you point out we could, very easily! I think we should - I'll add a note on the desktop PR. For your two questions: I'm happy to enable this Mac-only to start with, and expand support for other features separately, but in that case we do still need to make sure that the API (as defined by the desktop PR) is carefully designed & set up for expansion. Once any of this is shipped it stays shipped forever (especially in the desktop) so we'll have to remain compatible with it in future. We can't ship a I think that's actually fine though - we can handle this by making this I'll add some comments on the desktop PR to explain what I mean in a second. For the text you mentioned, we need to be a little clever, because the current text is still correct & valid for anybody using HTTP Toolkit from a browser without Electron (where they enter the app path manually with a
(Assuming the changes I'm about to propose on the desktop side, so that works) Does that make sense? |
Because, if added to httptoolkit-desktop, it will be supported on all platforms.
To take into account that on macOS on the desktop Electron executables can be selected again in the file picker, which means their path is not really “entered”.
@pimterry: Matching httptoolkit/httptoolkit-desktop#60 I also did the needed changes here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes here all look good to me, thanks for those changes. It's not strictly required, but I'd like to finish up some changes & testing in for the next desktop release and ship that before I merge this, so I'll leave this open for a little bit, but otherwise I think it's all good to go, thanks!
Requires httptoolkit/httptoolkit-desktop#60, done for httptoolkit/httptoolkit#329