How does CommandBox find my browser to launch on s...
# box-products
c
How does CommandBox find my browser to launch on start? Messing around on a Raspberry Pi and it throwing up an error that it can't find my browser. I'm assuming I can tell it where to look somewhere?
More less, a list of possible browsers is looped over and it runs
Copy code
which firefox
which chrome
which opera
...
until it finds one
Then it runs
Copy code
chrome <url>
or whichever binary it finds
So the full list it checks by default is
Copy code
String[] browsers = {"firefox", "chrome", "opera", "konqueror", "epiphany"};
The primary questions are • Does your Raspbian OS support
which
• and is your browser listed in those options
The good news is, you can overrride the default browser with this setting
Copy code
config set config set preferredBrowser=binaryNameHere
That bypasses the search and just runs
Copy code
binaryNameHere <url>
which does assume
binaryNameHere
is in the system path
c
Thanks Brad! Super helpful. The browser that was already installed by default is Chromium. Seems like it ought to find it. I'll take a look in the morning. Appreciate the help.
b
@caldjeff It all boils down to the name of the actual binary for Chromium
Looks like it's either
chromium-browser
or
chromium
Should just take a couple seconds to pop open a bash shell and test this
c
Bingo! Yep, "chromium-browser". Thanks for pointing me in the right direction. I'll override with your setting above.
b
Coolio
Feel free to add that browser to the array of built-in browsers CommandBox tries to search for.
You can send a pull request to the source file I linked to above
c
When I try to config set it says Command "preferredBrowser=chromium-browser" cannot be resolved. Do I need path?
b
That's not the syntax šŸ™‚
Did you follow the example in the docs I linked to?
c
lol...ok...did I mention I'm linux and CB noob?
b
Copy code
config set preferredBrowser=xxx
To set config settings you use the
config set
command
One nice thing about CommandBOx is there is tab completion for EVERYTHING. So at any point while typing the command or the param names, you can hit tab to make sure you're on track
c
Gotcha. Very helpful! I need to dig into docs a bit more and become more familiar with all the config stuff. I've been an Adobe CF guy for a long time and just trying to move myself to Lucee via CB. Always appreciate your patience and help.
b
No worries, and glad to help
I used to hate command line so I tried to make CommandBox have as few of those pain points as possible! šŸ™‚