summaryrefslogtreecommitdiff
path: root/program/js
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-04-28 10:58:21 +0200
committerAleksander Machniak <alec@alec.pl>2013-04-28 10:58:21 +0200
commitde6e22573ee3128b3a04deda70ef4181b8f4c721 (patch)
treee00ce61a7a76da54d351c22725e26a0952fda0a3 /program/js
parentd0f616c6e04560a2f6a90b39b3d1d4391b327c74 (diff)
Fix PDF support detection for Firefox PDF.js (#1488972)
Diffstat (limited to 'program/js')
-rw-r--r--program/js/app.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/program/js/app.js b/program/js/app.js
index 5d7e28640..58810c24a 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -6721,6 +6721,15 @@ function rcube_webmail()
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;
};