pojntfx / connmapper

Visualize your system's internet connections on a globe.
https://pojntfx.github.io/connmapper//docs/main/INSTALLATION.html
GNU Affero General Public License v3.0
16 stars 0 forks source link

Fatal error: unsupported browser #1

Open wmorgue opened 1 month ago

wmorgue commented 1 month ago

Hi šŸ‘‹ Saw your post on reddit and immediately downloaded the latest macOS version from: https://pojntfx.github.io/connmapper//dmg/main/com.pojtinger.felicitas.connmapper.main.darwin.dmg I got a fatal error when launching it:

2024/05/20 12:12:30 Listening on [::]:50125
2024/05/20 12:12:30 Backend URL: ws://localhost:50125
2024/05/20 12:12:30 Frontend URL: http://localhost:50126?socketURL=ws%3A%2F%2Flocalhost%3A50125
2024/05/20 12:12:39 Connmapper has encountered a fatal error and can't continue. The error message is:

Could not find a supported browser

The following information might help you in fixing the problem:

Tried to launch preferred browser binary (set with the HYDRAPP_BROWSER env variable) "[]" and known binaries "[{chromium [[google-chrome] [google-chrome-stable] [google-chrome-beta] [google-chrome-unstable] [brave-browser] [brave-browser-stable] [brave-browser-beta] [brave-browser-nightly] [microsoft-edge] [microsoft-edge-beta] [microsoft-edge-dev] [microsoft-edge-canary] [ungoogled-chromium] [chromium-browser] [chromium]] [[com.google.Chrome] [com.google.ChromeDev] [com.brave.Browser] [com.microsoft.Edge] [org.chromium.Chromium] [com.github.Eloston.UngoogledChromium]] [] [[/Applications/Google Chrome.app/Contents/MacOS/Google Chrome] [/Applications/Google Chrome Beta.app/Contents/MacOS/Google Chrome Beta] [/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary] [/Applications/Brave Browser.app/Contents/MacOS/Brave Browser] [/Applications/Brave Browser Beta.app/Contents/MacOS/Brave Browser Beta] [/Applications/Brave Browser Nightly.app/Contents/MacOS/Brave Browser Nightly] [/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge] [/Applications/Microsoft Edge Beta.app/Contents/MacOS/Microsoft Edge Beta] [/Applications/Microsoft Edge Dev.app/Contents/MacOS/Microsoft Edge Dev] [/Applications/Microsoft Edge Canary.app/Contents/MacOS/Microsoft Edge Canary] [/Applications/Chromium.app/Contents/MacOS/Chromium]]} {firefox [[firefox] [firefox-esr]] [[org.mozilla.firefox]] [] [[/Applications/Firefox.app/Contents/MacOS/firefox] [/Applications/Firefox Nightly.app/Contents/MacOS/firefox]]} {epiphany [[epiphany]] [[org.gnome.Epiphany]] [] []} {lynx [[lynx]] [] [] []}]"

Strack trace:

goroutine 1 [running]:
runtime/debug.Stack()
    /usr/local/go/src/runtime/debug/stack.go:24 +0x64
github.com/pojntfx/hydrapp/hydrapp/pkg/utils.HandlePanic({0x1400012ab20, 0xa}, {0x104ee88a7?, 0x22?}, {0x106fd6fe8?, 0x14000390100?})
    /go/pkg/mod/github.com/pojntfx/hydrapp/hydrapp@v0.0.0-20240512070742-0c2683657f84/pkg/utils/handle_panic.go:27 +0x124
main.main.func1({0x104ee88a7?, 0x71?}, {0x106fd6fe8?, 0x14000390100?})
    /hydrapp/work/main.go:80 +0x4c
github.com/pojntfx/hydrapp/hydrapp/pkg/browser.LaunchBrowser({_, _}, {_, _}, {_, _}, {_, _}, {_, _}, ...)
    /go/pkg/mod/github.com/pojntfx/hydrapp/hydrapp@v0.0.0-20240512070742-0c2683657f84/pkg/browser/desktop.go:177 +0x39c
main.main()
    /hydrapp/work/main.go:65 +0x4a8

Is there an option to use /Applications/Safari.app/ ? Safari version 17.4.1 (19618.1.15.11.14), macOS 14.4.1 (23E224), M2 SoC

pojntfx commented 1 month ago

Hi! Sadly there isn't a way to launch it in Safari just yet, at least not natively. You can use the dummy browser type and open the URL manually for now (see the contribution docs) - this is a hydrapp limitation.

The reason that Safari doesn't work just yet is that it doesn't have an equivalent of Chrome's application mode. Chrome, Edge, Brave, Firefox, Epiphany (Safari for Linux) etc. all support this, but Safari doesn't allow us to do that.

In your opinion as a user - what would you prefer we do for this use case? We can't use Safari without an application mode in production because we wouldn't have a way of knowing that the user closed the browser, so the app "server" (which does the connection tracing etc.) would leak and run in the background. Is a more descriptive error message maybe an option, maybe with a link to download one of the supported browser engines (Firefox/Chrome/Edge/Brave/Epiphany etc.)?

If you happen to know how to create a Safari web app programmatically, that would be optimal, but I haven't figured that out yet.

wmorgue commented 1 month ago

what would you prefer we do for this use case

The quickest thing to implement is to show a alert or view about an unsupported browser (fatalError(ā€¦) is something unexpected, like index out of bounds in Array).

I tried to find hidden url schemes for Safari, but couldn't find anything.

pojntfx commented 1 month ago

The quickest thing to implement is to show a alert or view about an unsupported browser

That's a pretty good idea, yeah currently I just have a catch-all handler for these irrecoverable things during browser launches. I'll try and get this done in the next few days, maybe I'll add a reference for where to download them as well ^^

pojntfx commented 1 month ago

FYI I'm now working in this: https://github.com/pojntfx/hydrapp/commit/b8a8bbed2a4a4d71bf62a95843d99a8db8416c2e

The basic idea is to format this specific error in a more human fashion, add download links to supported browsers, and allow manual configuration of an unsupported browser if no pre-installed browser can be found.

wmorgue commented 1 month ago

Sounds great! If you need help with testing, let me know

pojntfx commented 1 week ago

This is fully implemented now in upstream Hydrapp, with a full custom browser selection screen & links to download options. I'm working on preparing a new release over there now and will pull it here once it's ready.