Charles Robertson
01/27/2023, 11:24 AMserver.json
Why?
I have both Lucee & ACF powering the same local repo, using IIS, BonCode and CommandBox.
If I open both versions in the same browser, I get a SESSION issue. I have resolved this issue, by opening the ACF version in Chrome and the Lucee version in Firefox.
Currently, it is a hell of an effort, having to copy and paste the URL from Chrome into Firefox. I wondered, if there is a way I can alleviate this massive stress.π
But, seriously, I am kind of interested to know if we have this option? π
Update:
Theoretically, I could create a Windows shortcut and then do:
"openBrowserURL":"C:\\somepathTo\\shortcut-website-open-in-firefox - shortcut",
The question is, will this property accept a system path? I will tell you soon. Watch this space? πJonas Eriksson
01/27/2023, 12:02 PMbdw429s
01/27/2023, 7:58 PMpreferredBrowser but that doesn't quite give you what you wantbdw429s
01/27/2023, 7:59 PMserver open command also has a browser argumentbdw429s
01/27/2023, 7:59 PMserver open browser=chromeCharles Robertson
01/27/2023, 7:59 PMbdw429s
01/27/2023, 8:00 PMserver.json setting to override the browser used for the "automatic" browser that runwar pops up after your server starts. That just pulls your global preferreedBrowser settingbdw429s
01/27/2023, 8:00 PMserver.json setting for this-- can you put in a ticket please?bdw429s
01/27/2023, 8:01 PMserver.json to help
{
"scripts": {
"foo": "server open browser=chrome"
}
}
which you can fire with
server run-script foobdw429s
01/27/2023, 8:02 PMopenbrowser option as that would still use the default browser. You'd use runAsync and then fire whatever command yo wanted.
https://commandbox.ortusbooks.com/embedded-server/configuring-your-server/custom-tray-menus#runasync-exampleCharles Robertson
01/27/2023, 8:04 PM"openBrowserURL":"C:\\somepathTo\\shortcut-website-open-in-firefox",
But, your solutions are much nicer πbdw429s
01/27/2023, 8:04 PMserver.json-level setting right now by starting your server with a recipe like so
start-site1.boxr
config set preferredBrowse=chrome
server start site1
start-site2.boxr
config set preferredBrowse=firefox
server start site2bdw429s
01/27/2023, 8:05 PMpreServerStart script in your server.json to set the preferredBrowser before each start, which would work so long as both servers weren't starting at the same timebdw429s
01/27/2023, 8:05 PMAmazingly, this works:
Wow, that's is surprising... π€ I wonder if it's opening the actual shortcut in the first browser which then opens the second browser.Copy code"openBrowserURL":"C:\\somepathTo\\shortcut-website-open-in-firefox",
Charles Robertson
01/27/2023, 8:05 PMbdw429s
01/27/2023, 8:06 PMbdw429s
01/27/2023, 8:07 PM{
"name": "site1",
"browser": "chrome"
}
That's just a few lines of CF code to implementbdw429s
01/27/2023, 8:07 PMpreferredBrowser config settingCharles Robertson
01/27/2023, 8:09 PMbdw429s
01/28/2023, 1:52 AMbdw429s
01/28/2023, 1:57 AMbdw429s
01/28/2023, 1:57 AMserver set preferredBrowser=firefox
server openCharles Robertson
01/29/2023, 5:29 PM