From 967860765cb192a8c7efc0b7256eb34d8ab13c73 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Sun, 28 Apr 2013 10:58:21 +0200 Subject: Fix PDF support detection for Firefox PDF.js (#1488972) --- program/js/app.js | 9 +++++++++ program/resources/blank.pdf | Bin 0 -> 921 bytes 2 files changed, 9 insertions(+) create mode 100644 program/resources/blank.pdf (limited to 'program') diff --git a/program/js/app.js b/program/js/app.js index 5d6d2c1de..72425b455 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -6811,6 +6811,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; }; diff --git a/program/resources/blank.pdf b/program/resources/blank.pdf new file mode 100644 index 000000000..7bf83e390 Binary files /dev/null and b/program/resources/blank.pdf differ -- cgit v1.2.3