archimatetool/archi-scripting-plugin

Debugging Support

Phillipus opened this issue · 2 comments

This is to track the work of @jbsarrodie to implement debugging of scripts in MS Edge and Chrome browsers.

Dev branch: dev-jb.

I'm testing on Windows with Edge and Chrome. The first problem is getting Edge or Chrome to launch with the debug URL. It opens Edge or Chrome, but not the URL.

Here's a simple test snippet:

import java.io.IOException;

public class Test {

    public static void main(String[] args) {
        String port = "9229";
        String editor = "C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe";

        String path = java.util.UUID.randomUUID().toString();
        String url = "devtools://devtools/bundled/js_app.html?ws=127.0.0.1:" + port + "/" + path;

        String[] paths = new String[]{editor, url};

        try {
            Runtime.getRuntime().exec(paths);
        }
        catch(IOException ex) {
            ex.printStackTrace();
        }
    }
}

@jbsarrodie I've tried everything I can think of to get Chrome or Edge on Windows to automatically open a URL with the devtools:// protocol and it just can't be done.