fix printing?

main
radex 2024-02-02 22:21:56 +01:00
parent e801b26c10
commit a03ea047c1
Signed by: radex
SSH Key Fingerprint: SHA256:hvqRXAGG1h89yqnS+cyFTLKQbzjWD4uXIqw7Y+0ws30
2 changed files with 5 additions and 4 deletions

View File

@ -9,14 +9,14 @@
<!-- Firebase stuff is somewhat speculative, as the quota is exceeded as I'm adding this. --> <!-- Firebase stuff is somewhat speculative, as the quota is exceeded as I'm adding this. -->
<!-- Lax img-src is needed for speech recognition, e.g. interpret_command("draw a cat")[0].exec(); --> <!-- Lax img-src is needed for speech recognition, e.g. interpret_command("draw a cat")[0].exec(); -->
<!-- connect-src needs data:/blob: for loading images via fetch, including from local storage. --> <!-- connect-src needs data:/blob: for loading images via fetch, including from local storage. -->
<meta http-equiv="Content-Security-Policy" content=" <!-- <meta http-equiv="Content-Security-Policy" content="
default-src 'self'; default-src 'self';
script-src 'self' https://jspaint.firebaseio.com; script-src 'self' https://jspaint.firebaseio.com;
style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com;
img-src 'self' data: blob: http: https:; img-src 'self' data: blob: http: https:;
font-src 'self' https://fonts.gstatic.com; font-src 'self' https://fonts.gstatic.com;
connect-src * data: blob: https://jspaint.firebaseio.com wss://jspaint.firebaseio.com; connect-src * data: blob: https://jspaint.firebaseio.com wss://jspaint.firebaseio.com;
"> "> -->
<link href="styles/normalize.css" rel="stylesheet" type="text/css"> <link href="styles/normalize.css" rel="stylesheet" type="text/css">
<link href="styles/layout.css" class="flippable-layout-stylesheet" rel="stylesheet" type="text/css"> <link href="styles/layout.css" class="flippable-layout-stylesheet" rel="stylesheet" type="text/css">
@ -831,4 +831,4 @@
</svg> </svg>
</body> </body>
</html> </html>

View File

@ -1078,8 +1078,9 @@ function file_save(maybe_saved_callback = () => { }, update_from_saved = true) {
function print_zebra() { function print_zebra() {
write_image_file(main_canvas, 'image/png', (blob) => { write_image_file(main_canvas, 'image/png', (blob) => {
console.log(blob) console.log(blob)
fetch(`print?printer=zebra`, { fetch(`/print?printer=zebra`, {
method: 'POST', method: 'POST',
headers: { 'content-type': 'image/png' },
body: blob, body: blob,
}).then(response => { }).then(response => {
console.log({response}) console.log({response})