How to do javascript debugging with Google Chrome ?

I see that this was released as a feature.  How do we enable this?  I found some posts / pages which give some setting instructions.  But there is no relevant setting under debug -> javascript.

How do we enable this?  

Thanks,
Ankur

8 comments
Comment actions Permalink

Ankur,

There’s nothing special to enable. There’s a new ‘Browser’ combobox im RubyMine 3.2 that allows you to choose Chrome or Firefox in “JavaScript Debug”  run/debug configuration settings.

See attached screenshot.

Hope it helps,
-Eugene



Attachment(s):
js_debug_browser.png
0
Comment actions Permalink

OK Thank you.  I actually never used that before.  I didn't know about that, so one has to create a new Javascript debugger configuration.  To enable I was just clicking the check box to start Javascript debugger automatically.

thanks,
Ankur

0
Comment actions Permalink

When you start the JS debugger automatically a temporary configuration is created anyway. You can save it later.

A new configuration uses the browser selected in the default configuration.
You can change the default browser in 'Defaults->JavaScript Debug' section in Run/Debug Configurations window.

-Eugene

0
Comment actions Permalink

I still cannot get it to work.  I did the following:

Edited the default created run/debug configuration under JavaScript Debug.
Changed the Browser to Chrome instead of Firefox.
It informed that it needed to start chrome with a different profile directory.
I accepted defaults.
Restarted debugger, it said it could not find executable
I set executable in preferences, browser by giving it the application: /Applications/Google Chrome.app  For the mac
Restarted debugger again.  A new tab opens in Chrome and says:
" Waiting for connection from JetBrains RubyMine... " with URL of : file://localhost/var/folders/fK/fKjtVwTKEvGet6UsErLcg0pfyMQ/-Tmp-/chrome6940129041257492564.html

0
Comment actions Permalink

Well, getting the hang of it all.   The different profile was not being activated by Rubymine because Chrome was already started.  I disabled the different profile and it is connecting now.

The issue though is that I cannot put breakpoints on the on disk javascript file.  It does not activate breakpoints because it is not recognized as the remote URL loaded by the browser.  So to use breakpoints I have to go to the Scripts tab in the debugger, open that and then set breakpoints in it.

Anyway, at least I understand the settings.  It seems to be working as expected though.  Will the behavior of the javascript files be changed to match the way it works in Firefox or am I doing something wrong?

thanks,
Ankur

0
Comment actions Permalink

Breakpoints in remote URLs should work the same way as they work for Firefox: if you've specified remote URLs for local files in the JavaScript run configuration breakpoints in local files will be triggered when corresponding URLs are loaded in the browser.

0
Comment actions Permalink

With firefox it works as expected.  With Chrome, it does not recognize javafile.js?20119292 as the same as javafile.js on disk.  I have to specify that, then it does match up.  Should I make an issue for this?

0

Please sign in to leave a comment.