Browse Source

Merge pull request #9009 from Snuffleupagus/issue-5767

Only warn about unsupported JavaScript, in the viewer, when non-empty actions exist (issue 5767)
Tim van der Meij 8 years ago committed by GitHub
parent
commit
c80237729c
  1. 12
      web/app.js

12
web/app.js

@ -1047,10 +1047,18 @@ let PDFViewerApplication = {
return; return;
} }
pdfDocument.getJavaScript().then((javaScript) => { 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'); console.warn('Warning: JavaScript is not supported');
this.fallback(UNSUPPORTED_FEATURES.javaScript); this.fallback(UNSUPPORTED_FEATURES.javaScript);
} return true;
});
// Hack to support auto printing. // Hack to support auto printing.
let regex = /\bprint\s*\(/; let regex = /\bprint\s*\(/;
for (let i = 0, ii = javaScript.length; i < ii; i++) { for (let i = 0, ii = javaScript.length; i < ii; i++) {

Loading…
Cancel
Save