This page shows you how to debug Javascript remotely from IDEA in Chrome/Firefox.
In the run/debug windows, before starting the run, you need to map the first part of the URL (https://hostname:port) to the location in your project.
When starting a run debug, you can see by opening the devtool (F12) that the debug session in the browser is in sync with the debug session inside IDEA.