Skip to content
Phil Beauvoir edited this page Mar 24, 2025 · 16 revisions

Using the Chrome Debugger to trace through your script

Caution

The Chrome Debugger in jArchi should only be used if you know what you are doing. Using it incorrectly can freeze Archi, requiring a force quit. Use at your own risk!

The Chrome Debugger is an experimental feature in Archi 1.9. It allows you to trace through the execution of your script one line at a time in a supported browser and to set breakpoints.

Pre-requisites

  • Windows or Mac. Due to technical issues, Linux is not supported.
  • A Chrome based browser such as Google Chrome or MS Edge installed
  • Archi 5.5 or later
  • jArchi version 1.9 or later

Enabling

  1. To enable debugging open Archi's Preferences/Settings and find the "Scripting" pane, then check "Enable Chrome Debugging".
  2. The default port is set to 9229. You can change this if you like but this one should work for most cases.
  3. Set the path to the Chrome/Edge browser application. On Mac this will ensure that the browser is automatically opened and the devtools:// URL is set to go. On Windows, this will simply open a new browser instance, you will have to manually paste the devtools:// URL into the address bar.

Using the Debugger

  1. Ensure that Google Chrome or MS Edge is running (if you've set the path to the browser in Preferences you don't need to do this)
  2. Run an Archi script. A dialog box will appear with some explanation text and two buttons, "Continue" and "Debug".
  3. Press "Debug" to continue with the debug session. Press "Continue" to continue without debugging.
  4. If you press "Debug" a URL will be copied to the clipboard. On Windows, paste it into the address bar of Google Chrome or MS Edge. The URL is of the form devtools://devtools/bundled/js_app.html?ws=127.0.0.1:9229/b98b7b01-f10b-4f6b-823f-87e1a647068f. On Mac, if you've set the path to the browser you won't need to paste the URL into the address bar. Note that the UID in the URL is different for each debug session so you can't re-use it in another session.
  5. Your debug and trace session should start and you can step over lines of code and set breakpoints in the browser

Warning

If you don't follow the steps above correctly Archi will freeze and you will have to force quit!