mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Set isEvalSupported to false when loading a PDF document (#18444)
GitOrigin-RevId: 394d63571d83302b91b5719389adf49155218bc7
This commit is contained in:
parent
3cb4190ef0
commit
6569f49a92
3 changed files with 6 additions and 2 deletions
|
@ -33,7 +33,10 @@ const FileViewPdf: FC<{
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const pdf = await PDFJS.getDocument(preview.url).promise
|
const pdf = await PDFJS.getDocument({
|
||||||
|
url: preview.url,
|
||||||
|
isEvalSupported: false,
|
||||||
|
}).promise
|
||||||
|
|
||||||
// bail out if loading the PDF took too long
|
// bail out if loading the PDF took too long
|
||||||
if (!mountedRef.current) {
|
if (!mountedRef.current) {
|
||||||
|
|
|
@ -96,6 +96,7 @@ export default class PDFJSWrapper {
|
||||||
rangeChunkSize,
|
rangeChunkSize,
|
||||||
disableAutoFetch: true,
|
disableAutoFetch: true,
|
||||||
disableStream,
|
disableStream,
|
||||||
|
isEvalSupported: false,
|
||||||
textLayerMode: 2, // PDFJSViewer.TextLayerMode.ENABLE,
|
textLayerMode: 2, // PDFJSViewer.TextLayerMode.ENABLE,
|
||||||
range: rangeTransport,
|
range: rangeTransport,
|
||||||
})
|
})
|
||||||
|
|
|
@ -143,7 +143,7 @@ export class GraphicsWidget extends WidgetType {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const pdf = await PDFJS.getDocument(url).promise
|
const pdf = await PDFJS.getDocument({ url, isEvalSupported: false }).promise
|
||||||
const page = await pdf.getPage(1)
|
const page = await pdf.getPage(1)
|
||||||
|
|
||||||
// bail out if loading the PDF took too long
|
// bail out if loading the PDF took too long
|
||||||
|
|
Loading…
Reference in a new issue