Skip to content

Commit 9257e12

Browse files
committed
Adapt code for web version
1 parent 8930651 commit 9257e12

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

client/index.html

+22
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,28 @@
77
<!--<meta http-equiv="Content-Security-Policy" content="default-src 'self' http://localhost:5129 ws://localhost:5129 https://amiko.zirk.eu ws://amiko.zirk.eu; script-src 'self' 'unsafe-eval'">-->
88
<title>Amiko</title>
99
<script src="./js/renderer.js"></script>
10+
<script>
11+
// TODO: Move in a script
12+
if (typeof versions === 'undefined') {
13+
versions = {
14+
node: () => null,
15+
chrome: () => navigator.userAgent,
16+
electron: () => null
17+
};
18+
interaction = {
19+
open: (url) => window.open(url, '_blank').focus()
20+
};
21+
filesystem = {
22+
readAsync: async () => {
23+
var match = document.cookie.match(new RegExp('(^| )token=([^;]+)'));
24+
if (match) return match[2];
25+
},
26+
writeAsync: async (token) => {
27+
document.cookie = `token=${token}; max-age=2592000; path=/; SameSite=Strict`;
28+
}
29+
};
30+
}
31+
</script>
1032
<link rel="stylesheet" href="./node_modules/bulma/css/bulma.min.css"/>
1133
<link rel="stylesheet" href="./css/main.css"/>
1234
</head>

0 commit comments

Comments
 (0)