archimatetool / archi-scripting-plugin

jArchi - Scripting for Archi: ArchiMate Modelling Tool
https://www.archimatetool.com
118 stars 33 forks source link

Debugging Support #125

Open Phillipus opened 5 months ago

Phillipus commented 5 months ago

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

Dev branch: dev-jb.

Phillipus commented 5 months ago

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();
        }
    }
}
Phillipus commented 5 months ago

@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.