From 385a5f7dcc5ed0f0f47ca6f2aa35ec8d46769a7f Mon Sep 17 00:00:00 2001
From: vyv03354 <VYV03354@nifty.ne.jp>
Date: Sun, 17 Mar 2013 00:13:08 +0900
Subject: [PATCH] Add a console warning when JavaScript/AcroForm/XFA was found

---
 web/compatibility.js | 6 +++++-
 web/viewer.js        | 3 ++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/web/compatibility.js b/web/compatibility.js
index baf16ff27..0230dc5a2 100644
--- a/web/compatibility.js
+++ b/web/compatibility.js
@@ -390,7 +390,8 @@
   if (!('console' in window)) {
     window.console = {
       log: function() {},
-      error: function() {}
+      error: function() {},
+      warn: function() {}
     };
   } else if (!('bind' in console.log)) {
     // native functions in IE9 might not have bind
@@ -400,6 +401,9 @@
     console.error = (function(fn) {
       return function(msg) { return fn(msg); };
     })(console.error);
+    console.warn = (function(fn) {
+      return function(msg) { return fn(msg); };
+    })(console.warn);
   }
 })();
 
diff --git a/web/viewer.js b/web/viewer.js
index b37af2918..3437f590b 100644
--- a/web/viewer.js
+++ b/web/viewer.js
@@ -1316,6 +1316,7 @@ var PDFView = {
       if (PDFView.supportsPrinting) {
         pdfDocument.getJavaScript().then(function(javaScript) {
           if (javaScript.length) {
+            console.warn('Warning: JavaScript is not supported');
             PDFView.fallback();
           }
           // Hack to support auto printing.
@@ -1389,7 +1390,7 @@ var PDFView = {
         self.setTitle(pdfTitle + ' - ' + document.title);
 
       if (info.IsAcroFormPresent) {
-        // AcroForm/XFA was found
+        console.warn('Warning: AcroForm/XFA is not supported');
         PDFView.fallback();
       }
     });