-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
preview.html
37 lines (35 loc) Β· 960 Bytes
/
preview.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
<!DOCTYPE html>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at https://mozilla.org/MPL/2.0/. -->
<html>
<head>
<meta charset="utf-8" />
<style>
* {
box-sizing: border-box;
}
#preview {
text-align: center;
font-family: system-ui;
font-size: 24px;
margin: 4em;
word-wrap: break-word;
}
</style>
</head>
<body>
<div id="preview"></div>
<script>
async function main() {
const { file, path } = await quicklook.getPreviewedFile();
const contents = await file.text();
document.getElementById(
"preview"
).innerText = `File contents are: β${contents.trim()}β\n\nPath is: β${path}β`;
await quicklook.finishedLoading();
}
main();
</script>
</body>
</html>