mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
Merge pull request #9034 from Snuffleupagus/javascript-null
[api-major] Change `getJavaScript` to return `null`, rather than an empty Array, when no JavaScript exists
This commit is contained in:
commit
17cc94db4e
4 changed files with 16 additions and 8 deletions
|
@ -1035,10 +1035,12 @@ let PDFViewerApplication = {
|
|||
return;
|
||||
}
|
||||
pdfDocument.getJavaScript().then((javaScript) => {
|
||||
if (javaScript.length) {
|
||||
console.warn('Warning: JavaScript is not supported');
|
||||
this.fallback(UNSUPPORTED_FEATURES.javaScript);
|
||||
if (!javaScript) {
|
||||
return;
|
||||
}
|
||||
console.warn('Warning: JavaScript is not supported');
|
||||
this.fallback(UNSUPPORTED_FEATURES.javaScript);
|
||||
|
||||
// Hack to support auto printing.
|
||||
let regex = /\bprint\s*\(/;
|
||||
for (let i = 0, ii = javaScript.length; i < ii; i++) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue