forked from openfin/java-example
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlaunchExternal.html
More file actions
45 lines (34 loc) · 1.13 KB
/
launchExternal.html
File metadata and controls
45 lines (34 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<html>
<head>
<title>LaunchExternalProcess example</title>
<script type="text/javascript">
window.addEventListener("DOMContentLoaded", function() {
fin.desktop.InterApplicationBus.subscribe('*', 'messageFromJavaTopic', m => {
document.getElementById("messageFromJava").innerText = JSON.stringify(m);
console.log(m);
});
});
function launch() {
const inputBox = document.getElementById('path');
fin.System.launchExternalProcess({
path: inputBox.value,
arguments: "",
listener: function (result) {
console.log('the exit code', result.exitCode);
}
}).then(processIdentity => console.log(processIdentity)).catch(err => console.log(err));
}
</script>
</head>
<body>
<script>
</script>
<p>LaunchExternalProcess example</p>
<div id="messageFromJava">
</div>
<div>
Full Path <input id="path" type="text" style="width: 400px" ></input>
<Button id="launch" onclick="launch()"> Launch </Button>
</div>
</body>
</html>