generated from electron/electron-quick-start
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
46 lines (37 loc) · 1.26 KB
/
index.html
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
46
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
<!-- NOTE: This needs to be disabled to permit the native modules to run; probably the wrong tool for
doing this and requires a bit of investigation.
-->
<!-- <meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'"> -->
<meta http-equiv="X-Content-Security-Policy" content="default-src 'self'; script-src 'self'">
<title>Hello World!</title>
</head>
<body>
<h1>Rust local package hello</h1>
<script>
try {
document.write(`<pre>${require('hello').hello()}</pre>`);
} catch (e) {
document.write(`<pre>${e.stack}</pre>`);
}
</script>
<h1>Rust externally imported library</h1>
<pre>@amilajack/neon-hello</pre>
<script>
try {
document.write(`<pre>${require('@amilajack/neon-hello').helloWorld()}<pre>`);
} catch (e) {
document.write(`<pre>${e.stack}</pre>`);
}
</script>
We are using Node.js <span id="node-version"></span>,
Chromium <span id="chrome-version"></span>,
and Electron <span id="electron-version"></span>.
<!-- You can also require other files to run in this process -->
<script src="./renderer.js"></script>
</body>
</html>