Debug opens the wrong browser

I have PhpStorm 2017.1.4 running on Ubuntu 16.04.4 LTS 64-bit.

Running FireFox debug uses the Google Chrome debugger no mater what I do.  In particular, I can't get it to run in Firefox. I go to "Run | Debug ..." and click on "Edit Configurations ...".  The browser dropdown shows "Debug" with a Firefox logo.  I click on the "..." button to the right of that. I try all three options for the "Default Browser "item. 

1. "System default" presumably should point to Firefox since that is how I've configured that in the OS to be my default browser.

2. "First listed" points to Firefox as I confirm in the path box to the right.

3. "Custom path" points to Firefox.  Copy and paste form the path box to a terminal window calls Firefox.

In all cases, trying to debug calls Google Chrome.  Trying to Run ("Run | Run ..." uses Firefox.

I've gotten Chrome set up to be usable as debugging browser.  However, I personally prefer Firefox (so sue me).  Besides, there is always the possibility of running into non-Chrome browser-specific bugs. I need to be able to use something other than chrome for that.

Ideas?  Thanks in advance.

 

13 comments
Comment actions Permalink

Hello!

This has been the same behaviour for me, for a couple of PHPStorm versions as well.

OS default is firefox, I have firefox as first choice in the list as well, plus I unchecked Chrome in the list of browsers.

My "Run javascript" action will still open up chrome.

PhpStorm 2021.1.2
Build #PS-211.7142.44, built on April 30, 2021

1
Comment actions Permalink

@Lorant Bene

My "Run javascript" action will still open up chrome.

That is correct behaviour: JavaScript debug is basically Chrome-based (see the first link for some details).

For Firefox you have to manually create and use Firefox Remote type of Run/Debug Configuration:

1
Comment actions Permalink

Please check this section of the Help, perhaps it will help you: https://www.jetbrains.com/help/webstorm/debugging-javascript-in-chrome.html

1
Comment actions Permalink

Hi there,

What language/code are you trying to debug -- PHP or JavaScript?

Better show a screenshots of your Run/Debug config used etc -- the way how Debug can be invoked from context menu can be quite confusing -- you have to pay attention to the icon .. ro you may end up creating the configuration for wring language etc.

JavaScript debug is basically Chrome-only .. unless you will use Firefox Remote debug.

In general (may be a bit out of date as for the latest version though): https://confluence.jetbrains.com/display/PhpStorm/JavaScript+Debugging+in+PhpStorm

0
Comment actions Permalink

In my case on macOS, when I tried to debug javascript, IDEA kept opening VMware Fusion to try to run Chrome in Windows.

Turns out that my /Applications/Google Chrome.app was not native but instead was put there by VMware, and my native Chrome was somewhere else.

The VMware version contains this

/Applications/Google\ Chrome\ VMware.app/Contents/MacOS/vmware-docker

instead of the usual stuff that launches a native app.

My problem went away after I moved the VMwarized app to "Google Chrome in VMware.app" and moved the native one to /Applications/Google Chrome.app

It would be nice if the IDEA config UI would cover this situation.

0
Comment actions Permalink

IDEA is picking up OS defaults.

Not sure if it's worth implementing a detection mechanism that would check if the path is in any way related to VMware.app.

0
Comment actions Permalink

Don't know if anyone is still reading this, but for me it's the opposite:
My sys default browser is Firefox (Ubuntu 20.10) but I want to debug in Chrome.
I can't get webstorm to start the chrome browser. No matter what I do it starts firefox.

Any idea?
Cheers,
Felix

0
Comment actions Permalink

@Felix

Show your settings. What type of Run/Debug Configuration do you use? What button/icons do you click to do the debug etc etc. Anything that would help understanding what you are doing.

0
Comment actions Permalink

Andriy Bazanov
Yes, sorry. Not really useful information.
(I am not even sure if I understand the debug feature correctly - sorry, stupid backend engineer ;-)

Then I click on the green debug button, as I would do in any Java / C / Go whatever application.
Firefox opens.

I expect remote debugging as for example with Java Remote Debugging.

0
Comment actions Permalink

By the way: When I click on this link in the log output. It respects the preference and opens chrome (but without debugging mode)

0
Comment actions Permalink

So you are trying to debug the npm script, right?

1. I'm not really a JavaScript person (rather basic JS + some jQuery and alike) .. but I strongly believe this is a wrong way of debugging your app. I believe this is for debugging an actual npm script itself (using your Node.js and not the browser).

https://www.jetbrains.com/help/webstorm/installing-and-removing-external-software-using-node-package-manager.html#ws_npm_running_npm_scripts

2. As stated on your 2nd screenshot (the execution of that task) ... it is actually "npm start" that does launch the OS default browser (look at the "Starting the development server..." and the next line).

 

By the way: When I click on this link in the log output. It respects the preference and opens chrome (but without debugging mode)

Correct. Because it just normally opens the URL in your preferred browser. That's it.

0
Comment actions Permalink

Andriy Bazanov
Yes, got it. It tries to debug the npm script itself. Makes sense to me.

Alright. I am debugging in Firefox and Chrome directly in the DevConsole and the Browser's react plugins right now.
I'll read again how to set this up correctly.

Anyway, thanks so far for your time!
Cheers

0

Please sign in to leave a comment.