Spaces:
Running
Running
Commit ·
ef55b85
1
Parent(s): cbe1edf
Fix PDF preview for Chrome
Browse files- js/main.js +5 -3
js/main.js
CHANGED
|
@@ -554,12 +554,14 @@ class App {
|
|
| 554 |
this.currentPreviewObjectUrl = URL.createObjectURL(pdfBlob);
|
| 555 |
body.innerHTML = `
|
| 556 |
<div class="preview-pdf-wrap" style="width:100%; height:100%; display:flex; flex-direction:column;">
|
| 557 |
-
<
|
| 558 |
src="${this.currentPreviewObjectUrl}"
|
| 559 |
type="application/pdf"
|
| 560 |
-
|
|
|
|
|
|
|
| 561 |
title="${file.name} preview"
|
| 562 |
-
|
| 563 |
</div>`;
|
| 564 |
} catch (err) {
|
| 565 |
body.innerHTML = this.previewFallback(
|
|
|
|
| 554 |
this.currentPreviewObjectUrl = URL.createObjectURL(pdfBlob);
|
| 555 |
body.innerHTML = `
|
| 556 |
<div class="preview-pdf-wrap" style="width:100%; height:100%; display:flex; flex-direction:column;">
|
| 557 |
+
<embed
|
| 558 |
src="${this.currentPreviewObjectUrl}"
|
| 559 |
type="application/pdf"
|
| 560 |
+
width="100%"
|
| 561 |
+
height="100%"
|
| 562 |
+
style="flex:1; border:0;"
|
| 563 |
title="${file.name} preview"
|
| 564 |
+
/>
|
| 565 |
</div>`;
|
| 566 |
} catch (err) {
|
| 567 |
body.innerHTML = this.previewFallback(
|