I have the following alias in my dotfiles which I use to start Chrome with specific arguments:
alias chrome="nohup /usr/bin/google-chrome-stable --remote-debugging-port=9222 &> ~/.chrome.nohup.out & disown"
I always start my Chrome with this alias because I need those arguments to connect the debugger in VSCode for example. I might have other arguments in the future there as well.
However, if I click a link in some other application (like Slack), a new different Chrome instance is opened. I don't want to have multiple chrome instances running.
Question: How do I set the system-wide protocol handlers for http and https to my running Chrome instance? And how about opening a .html
file from Nautilus?
Could I approach this via a shell script to start Chrome, which is symlinked to from /etc/alternatives/x-www-browser
and /etc/alternatives/gnome-www-browser
? Or should I try setting the BROWSER
env var? Will those connect to my already running instance or start a new one?
I am asking this question here on AskUbuntu, but I'd love to get a generic solution which also works on the Debian+Gnome or Debian+Xfce installations I have as well. Bonus points if your answer works for Firefox too :)
0 Answers