-
-
Notifications
You must be signed in to change notification settings - Fork 169
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
Default Browser Not Opening Correctly with --default-browser
Parameter
#416
Comments
Consider using the `--browser chrome` option to specify the browser you
want to use.
…On Wed, Aug 28, 2024 at 21:27 Roberto Leinardi ***@***.***> wrote:
*Describe the bug*
Since a couple of releases of the GlobalProtect-openconnect CLI client,
the default browser is not opening correctly anymore. My default browser is
set to Chrome, and in the past, it always worked fine using the parameter
--default-browser. However, now it always opens Firefox instead of Chrome.
*Expected behavior*
When using the GlobalProtect-openconnect CLI client with the
--default-browser parameter, I expected my default browser, Chrome, to
open automatically, as it did in previous versions.
*Screenshots*
*No screenshots available*
*Logs*
- GUI version: Not applicable.
- CLI version:
sudo gpclient --fix-openssl connect address-redacted.com --default-browser
[2024-08-28T13:10:12Z INFO gpclient::cli] gpclient started: 2.3.7 (2024-08-16)
[2024-08-28T13:10:12Z INFO gpapi::portal::prelogin] Portal prelogin with user_agent: PAN GlobalProtect
[2024-08-28T13:10:12Z INFO gpapi::portal::prelogin] Perform prelogin, user_agent: PAN GlobalProtect
[2024-08-28T13:10:12Z INFO gpauth::cli] gpauth started: 2.3.7 (2024-08-16)
[2024-08-28T13:10:12Z INFO gpauth::cli] Fixing OpenSSL environment
[2024-08-28T13:10:12Z INFO gpapi::process::browser_authenticator] Launching the default browser...
[2024-08-28T13:10:12Z INFO gpauth::cli] Please continue the authentication process in the default browser
[2024-08-28T13:10:12Z INFO gpauth::cli] Listening authentication data on port 36877
[2024-08-28T13:10:12Z INFO gpauth::cli] If it hangs, please check the logs at `/tmp/gpcallback.log` for more information
*Environment:*
- OS: Ubuntu 22.04.4 LTS
- Desktop Environment: GNOME
- Output of ps aux | grep 'gnome-keyring\|kwalletd5' | grep -v grep: rleinar+
4311 0.0 0.0 388896 7372 ? Sl 08:42 0:00 /usr/bin/gnome-keyring-daemon
--daemonize --login
- Is remote SSH? No
*Additional context*
This issue started appearing after recent updates to the
GlobalProtect-openconnect CLI client. Previously, using the
--default-browser parameter correctly opened the default browser set in
the system preferences.
Probably related to the changes from #360
<#360>
—
Reply to this email directly, view it on GitHub
<#416>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAZFCQTQ3YWK7STOFK23VDDZTXF2XAVCNFSM6AAAAABNIJPHZOVHI2DSMVQWIX3LMV43ASLTON2WKOZSGQ4TEMBXHE3DSNI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Thanks, I'm already using that workaround, but still it's a issue that |
Does `--browser default` work for you
…On Wed, Aug 28, 2024 at 23:08 Roberto Leinardi ***@***.***> wrote:
Thanks, I'm already using that workaround, but still it's a issue that
--default-browser is not actually starting the default browser, like it
used to do before the regression.
—
Reply to this email directly, view it on GitHub
<#416 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAZFCQR2WNCI63BRTZIAWKTZTXRYDAVCNFSM6AAAAABNIJPHZOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMJVGYZTANZZGA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Unfortunately not: it behaves exactly like |
The default-browser option can still launch the browser, but it is not the default one, right? Can you finish authentication in the launched browser? |
Hi @leinardi, both the |
Hi @yuezk, I have another installation of Ubuntu 24.04, but I'm also available to do a remote debugging session using TeamViewer or some other remote desktop software if you want to have a look at what's going on on my 22.04.4. Anyway, I did some more tests and I found out a strange behavior...
but if I replace I installed How is And I double checked and Chrome is the default browser of the system: And this is the output of $ xdg-settings get default-web-browser
google-chrome.desktop and |
@leinardi under the hood, it will use
|
Hi @yuezk
This question was already answered in my previous comment:
ok this is very strange:
The interesting thing is that the default application associated with it (if I press the "Reset" button) is Firefox and not Chrome: Unfortunately But Btw you can find if there is a mismatch between the default browser and the MIME type associated with .html running these commands: $ xdg-mime query default text/html
firefox.desktop
$ xdg-settings get default-web-browser
google-chrome.desktop so it would be possible to find a solution that works on every distribution if you run #!/bin/bash
# Get the .desktop file for the default web browser
desktop_file=$(xdg-settings get default-web-browser)
# Look for the .desktop file in standard locations
desktop_file_path=$(find /usr/share/applications ~/.local/share/applications -name "$desktop_file" 2>/dev/null | head -n 1)
# Check if the .desktop file was found
if [ -z "$desktop_file_path" ]; then
echo "Error: Could not find the .desktop file for the default web browser."
exit 1
fi
# Extract the Exec line, which typically starts with "Exec="
exec_line=$(grep -i '^Exec=' "$desktop_file_path" | head -n 1)
# Remove the "Exec=" prefix and take only the first word (the binary path)
browser_binary=$(echo "$exec_line" | sed 's/^Exec=//' | awk '{print $1}' | sed 's/\"//g')
# Check if the binary path is found
if [ -z "$browser_binary" ]; then
echo "Error: Could not extract the browser binary path."
exit 1
fi
# Output the path to the binary
echo $browser_binary |
@leinardi thanks for sharing this! I will fix it. BTW, do you have the |
@yuezk nope, it is not set: |
Yes, the default browser detection can be enhanced. I will fix it in the next release. |
This should be fixed in https://github.com/yuezk/GlobalProtect-openconnect/releases/tag/v2.3.8. Let me know if it still doesn't work. |
Hi @yuezk thank you for the fix! It's confirmed to be working for me on Ubuntu 24.04.1 🎉 |
Describe the bug
Since a couple of releases of the GlobalProtect-openconnect CLI client, the default browser is not opening correctly anymore. My default browser is set to Chrome, and in the past, it always worked fine using the parameter
--default-browser
. However, now it always opens Firefox instead of Chrome.Expected behavior
When using the GlobalProtect-openconnect CLI client with the
--default-browser
parameter, I expected my default browser, Chrome, to open automatically, as it did in previous versions.Screenshots
No screenshots available
Logs
Environment:
ps aux | grep 'gnome-keyring\|kwalletd5' | grep -v grep
:rleinar+ 4311 0.0 0.0 388896 7372 ? Sl 08:42 0:00 /usr/bin/gnome-keyring-daemon --daemonize --login
Additional context
This issue started appearing after recent updates to the GlobalProtect-openconnect CLI client. Previously, using the
--default-browser
parameter correctly opened the default browser set in the system preferences.Probably related to the changes from #360
The text was updated successfully, but these errors were encountered: