How does JavaScript debugging in Firefox work?
I never managed to use the JavaScript debugging feature, and am trying again now with version 95.105. I setup a remote Firefox Run/Debug configuration. I start the debugging in IntelliJ, and in the debug panel see "Waiting for connection on port 7,812". Then in Firefox, I load the page I want to debug, and right click, and choose Debug in IDEA. This gives me a dialog with the message "Close Firefox. A copy of Firefox is already open. Only one copy of Firefox can be open at a time." I don't get it... I am in Firefox, and would like the IntelliJ plugin to connect to IntelliJ. Am I missing something?
Alex
请先登录再写评论。
Looks like IDEA cannot connect to Firefox. When you start JavaScript Debug configuration the message in the debug view should change from 'Waiting for
connection' to 'Connected to Firefox'. May be it is related to the problem desribed at http://www.jetbrains.net/devnet/message/5263210#5263210.
--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
Hi Nikolay,
I didn't get any of those nasty NS_ERROR_NOT_AVAILABLE with the latest EAP. But let's see I understand this correctly:
1. I already have a Firefox running.
2. I start the debugging in IntelliJ, and get the message "Waiting for connection on port 7,812".
3. Now I need to tell Firefox to connect to IntelliJ. If that Firefox was started by IntelliJ, it would connect by itself, but since it isn't, I assume this is what "Debug in IDEA" does.
Is this correct? If it is, it doesn't work for me. It seems that doing "Debug in IDEA" from Firefox tries to start another Firefox.
Alex
Actually after step 2 IDEA should connect to Firefox automatically so you don't need to perform step 3.
--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
Nikolay,
But if I started Firefox (not IntelliJ started Firefox), how would the add-on know when it needs to connect to IntelliJ? Wouldn't I need to tell the add-on "now there is an IntelliJ listening, try to connect to it"?
Alex
When you start JavaScript debug configuration from IDEA it runs Firefox executable with a special command line paramater which is handled by Firefox
Extension.
--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
Nikolay,
Yes, I understand this. But does that mean that to be able to connect to IntelliJ, Firefox always needs to be started by IntelliJ? Say I have a Firefox that I started last week, and now want to debug something. I can't just tell Firefox "now connect to IntelliJ"; I would have to exit Firefox, and let IntelliJ restart it. Is that right?
Alex
Alex,
'Debug in IDEA' is supposed to do what you want. It should start a debug session in IDEA and connect it to the current Firefox instance.
--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
Nikolay,
Alright; then we're on the same page. And the issue for me, is that when I run that "Debug in IDEA" in Firefox, I get a dialog telling me that Firefox is already started, as if it tried to start another Firefox. I assume that you're not seeing this?
Alex
Yes, it works for me.
--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"