Allow the "Open Connection" feature of IC2 to use the IntelliJ configured default browser instead of the OS System default.

Issue #2072 resolved
Mike Wannamaker created an issue

On my MacOS default browser is set to something other than Chrome. In IntelliJ standard configuration I have configured IntelliJ to use Chrome as the default browser. I like using Chromes debug tools, however I don’t want to use Chrome for personal browsing.

When I use the Open Connection it uses my system default browser and not the one configured inside IntelliJ. 

Since the "sfdx force:org:open" command now supports specifying the desired browser, per your email 😉, perhaps we could change the Open Connection to use this new feature.

Could even be nice to add an Open with … to be able to select the browser from the configured ones in IntelliJ, that way it would be easier to test in different browser types.

Comments (10)

  1. Scott Wells repo owner

    Thanks, Mike. And just to clarify, this is only an issue for projects configured to use a CLI connection, i.e., OAuth or a scratch org. For projects configured to use a native connection the IDE's browser configuration is already used. For CLI connections, though, IC2 uses sfdx force:org:open to open the desired page to ensure a valid access token. I'd just need to see which browser is configured as default in the IDE and pass the appropriate flag to force:org:open.

  2. Scott Wells repo owner

    Delivered in 2.2.1.4. Note that the only allowed options for the browser by the force:org:open command are chrome, firefox, and edge. Oddly safari is not an option on Mac. If a match can't be made, the system default browser is still used.

  3. Mike Wannamaker reporter

    Hey Scott, I just noticed that when configuring a new connection, which opens a browser to authenticate, uses the system default.

    Any chance we could change this as well? Or have a config option to allow to use the IntelliJ configured ones?

    Thanks Mike

  4. Scott Wells repo owner

    Mike, that uses the force:auth:web:login command which doesn't accept any option to specify the browser which should be used. You'd need to log a CLI issue similar to the following:

    https://github.com/forcedotcom/cli/issues/1015

    but for that command to control the browser used for Web login flow OAuth. If/when such an option is added, I could certainly update IC2 to use it.

  5. Scott Wells repo owner

    Thanks, John. I know that there’s another issue in the CLI issue tracker that talks more about the library that they use specific browsers and its limitations. I can’t find a link right now, but it says specifically that it’s not (currently) possible to get the right local callback required when using incognito/private modes as well as why Safari isn’t currently supported. Hopefully they’ll link your issue to that one for context. Of course, if/when those things are possible, I’ll be happy to add support in IC2, but right now it isn’t sounding very promising. Just a heads up.

  6. Log in to comment