Merge pull request #9009 from Snuffleupagus/issue-5767
Only warn about unsupported JavaScript, in the viewer, when non-empty actions exist (issue 5767)
This commit is contained in:
commit
c80237729c
12
web/app.js
12
web/app.js
@ -1047,10 +1047,18 @@ let PDFViewerApplication = {
|
||||
return;
|
||||
}
|
||||
pdfDocument.getJavaScript().then((javaScript) => {
|
||||
if (javaScript.length) {
|
||||
if (javaScript.length === 0) {
|
||||
return;
|
||||
}
|
||||
javaScript.some((js) => {
|
||||
if (!js) { // Don't warn/fallback for empty JavaScript actions.
|
||||
return false;
|
||||
}
|
||||
console.warn('Warning: JavaScript is not supported');
|
||||
this.fallback(UNSUPPORTED_FEATURES.javaScript);
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
// Hack to support auto printing.
|
||||
let regex = /\bprint\s*\(/;
|
||||
for (let i = 0, ii = javaScript.length; i < ii; i++) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user