use separate firefox instance

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….

 

Thanks,

dave

3 comments

Actually you can specify which profile should be used by IDEA (Settings | Web Browsers | Firefox | 'Settings...' button). However 'no-remote' option
is not supported. There is a feature request for this: http://youtrack.jetbrains.net/issue/WI-2540.

I would like to use a seperate firefox instance for my debugging instance (a pretty standard development approach I believe). I know how to launch the seperate instance on the Firefox side (-no-remote combined with -p), but I don't how to get IntelliJ to use that instance. It tries to open a new window in the default profile/instance, which doesn't have the plugin so it hangs.

>

It seems to me a good enhancement to support this would be the ability to set the listener port like you can do with a 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.

>

Any possibility of that approach or do you have some other suggested solution? I can't debug in my main Firefox instance, there is just too much going on.

>

Thanks,
dave

>

---
Original message URL: http://devnet.jetbrains.net/message/5275996#5275996



--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0
Nikolay wrote:


Actually you can specify which profile should be used by IDEA (Settings | Web Browsers | Firefox | 'Settings...' button). However 'no-remote' option
is not supported. There is a feature request for this: http://youtrack.jetbrains.net/issue/WI-2540.



The problem with the profile option is that it is ignored when FIrefox is already running. It just opens a window in the current non-no-remote instance.

And as I mention above, just adding -no-remote doesn't fix this. It works the first time if no instance is running that profile. But if an instance is running that profile it just gives an error.

In someways its a limitation of Firefox in that you can target which instance you want the command line to call, but since IDEA has a listening plugin it can go around that (just like you can go around how to launch a JVM and just connect to the right port).

d

0

reesd wrote:


The problem with the profile option is that it is ignored when FIrefox is already running. It just opens a window in the current non-no-remote instance.

And as I mention above, just adding -no-remote doesn't fix this. It works the first time if no instance is running that profile. But if an instance is running that profile it just gives an error.

In someways its a limitation of Firefox in that you can target which instance you want the command line to call, but since IDEA has a listening plugin it can go around that (just like you can go around how to launch a JVM and just connect to the right port).

d


I'm happy to say that in WS-102.206 (and possibly the version before it) it seems to now use listening port in a way similar to what I described above!

So if Firefox has the JetBrains plugin already running then WS will use it directly rather than starting Firefox on the command line. That means you can have your a 1st Firefox instance running for normal browsing, then start a 2nd Firefox instance using -no-remote with just the plugins you want for development (including the JetBrains connector), then when you hit debug in WS it will use the 2nd instance (because that is the one that has the jetbrain connector in it). Note you still need to have the right profile set under Settings>Web Browsers>Firefox - it uses that profile to install/upgrade the connector when needed.


Great improvement guys!

d

0

Please sign in to leave a comment.