This feature is only supported in the Ultimate edition.
During a debugging session, you can view the HTML source code that implements the actual browser page and its HTML DOM structure
in the Elements tab of the Debug tool window.
Moreover, any changes made to the page through the browser are immediately reflected in the Elements tab.
Currently this functionality is supported only for Google Chrome
and only during
a debugging session.
Before you start
- Install the JetBrains Chrome extension in your Chrome browser, see Installing JetBrains Chrome extension.
- Make sure the LiveEdit repository plugin is installed and enabled. The plugin is not bundled with IntelliJ IDEA, but it can be installed from the JetBrains plugin repository as described in Installing, Updating and Uninstalling Repository Plugins and Enabling and Disabling Plugins.
- Activate the Live Edit functionality by selecting the Update application in Chrome checkbox on the Live Edit page. For details, see Activating Live Edit.
To view the HTML source and DOM structure of the actual page
-
To start a debugging session, create a run configuration
of the type JavaScript Debug
and click the Debug button
on the toolbar.
IntelliJ IDEA establishes connection with the JetBrains Chrome extension and starts a debugging session.
-
Switch to the Debug tool window and open the Elements tab.
The tab consists of three panes, all the panes are read-only. The Text pane shows the HTML source code of the page that is currently opened in the browser.
As soon as any change is made to the page in the browser (e.g. clicking an icon), the code in the pane is updated accordingly.
The Structure pane shows the DOM structure of the HTML code in the Text pane. The Scripts pane shows a tree of executed scripts. The Structure and the Text panes are mutually synchronized. When you click a node in the DOM structure, IntelliJ IDEA scrolls through the contents of the Text pane. The panes are also synchronized with the browser: as soon as you click a node in the DOM structure or in the Text pane, IntelliJ IDEA highlights the corresponding element in the browser.