From de6e22573ee3128b3a04deda70ef4181b8f4c721 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Sun, 28 Apr 2013 04:58:21 -0400
Subject: [PATCH] Fix PDF support detection for Firefox PDF.js (#1488972)

---
 program/js/app.js |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/program/js/app.js b/program/js/app.js
index 5d7e286..58810c2 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -6721,6 +6721,15 @@
         return 1;
     }
 
+    // this will detect any pdf plugin including PDF.js in Firefox
+    var obj = document.createElement('OBJECT');
+    obj.onload = function() { rcmail.env.browser_capabilities.pdf = 1; };
+    obj.onerror = function() { rcmail.env.browser_capabilities.pdf = 0; };
+    obj.style.display = 'none';
+    obj.type = 'application/pdf';
+    obj.data = 'program/resources/blank.pdf';
+    document.body.appendChild(obj);
+
     return 0;
   };
 

--
Gitblit v1.9.1