Skip to content

Commit a1e3768

Browse files
committed
fix: avoid insert embed tag on the main thread which cause Safari on Big Sur freezing
upgrade pdfobject to version 2.2.4 Signed-off-by: Max Wu <jackymaxj@gmail.com>
1 parent dd16949 commit a1e3768

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@
173173
"nyc": "~14.0.0",
174174
"optimize-css-assets-webpack-plugin": "~5.0.0",
175175
"papaparse": "^5.2.0",
176-
"pdfobject": "~2.1.1",
176+
"pdfobject": "~2.2.4",
177177
"plantuml-encoder": "^1.2.5",
178178
"power-assert": "~1.6.1",
179179
"prismjs": "^1.17.1",

public/js/extra.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -597,9 +597,11 @@ export function finishView (view) {
597597
const url = $(value).attr('data-pdfurl')
598598
const inner = $('<div></div>')
599599
$(this).append(inner)
600-
PDFObject.embed(url, inner, {
601-
height: '400px'
602-
})
600+
setTimeout(() => {
601+
PDFObject.embed(url, inner, {
602+
height: '400px'
603+
})
604+
}, 1)
603605
})
604606
// syntax highlighting
605607
view.find('code.raw').removeClass('raw')

0 commit comments

Comments
 (0)