I would like to use a separate firefox instance for my debugging instance (a pretty standard development approach I believe). I can't debug in my main Firefox instance, there is just too much going on.
I can launch a separate instance on the Firefox side (-no-remote combined with –p to indicate the profile) as described here - http://kb.mozillazine.org/Opening_a_new_instance_of_Firefox_with_another_profile. The problem is getting IntelliJ to use that instance. If just click debug it opens a new window in the default profile/instance, which doesn't have the plugin so it hangs.
The solution I have come up with is to create a .bat file that adds the no-remote to IntelliJ’s firefox call and then pointing IntelliJ to that bat file for Firefox. The contents of it are as follows:
"C:\Program Files\Mozilla Firefox\firefox.exe" %* -no-remote
This works ok at first if Firefox is not running, IntelliJ starts a new instance of Firefox (thanks to the -no-remote) with the right profile (since IJ passes –p profile as part of the startup). The problem is I can’t open any new files or “debug” a different file because IJ calls the bat file for them, and that calls Firefox again with the –no-remote, which gives me the “Firefox is already running” error.
I don’t know a way around this using the command line to start Firefox, but since you actually a running plugin that is listening on a port I would like to suggest the following enhancement. It would good to set the listener port like you can do with an IDEA Remote debug configuration for JVMs. So basically I could set a port in the Jetbrains debugger extension plugin options (or perhaps as a command line option when starting the instance) and then set the same port in the debug configuration (like you can for a JVM). When I click debug the debugger tries the port to see if its already open, and if so pushes the URL through the port to the Firefox instance, then connects.
In the meantime I am going to stick with my solution and manually open files from inside the right Firefox instance. That and I use Firebug for quick stuff. That works ok, and as I mentioned I really can’t use my main instance – there are just two many plugins cluttering up the logs and other things.
I would also like to hear other approaches if folks have them….