summaryrefslogtreecommitdiff
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:58 +0200
commit967860765cb192a8c7efc0b7256eb34d8ab13c73 (patch)
tree6a5ccd41d2bc951fa0b96f49f02339f40380b558
parentcf3f125784601209c53e2f901c78c9d87feca809 (diff)
Fix PDF support detection for Firefox PDF.js (#1488972)
-rw-r--r--CHANGELOG1
-rw-r--r--program/js/app.js9
-rw-r--r--program/resources/blank.pdfbin0 -> 921 bytes
3 files changed, 10 insertions, 0 deletions
diff --git a/CHANGELOG b/CHANGELOG
index a9d42549d..0dfc73b81 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,7 @@
CHANGELOG Roundcube Webmail
===========================
+- Fix PDF support detection for Firefox PDF.js (#1488972)
- Fix messages list focus issue in Internet Explorer (#1489058)
- Fix possible collision in generated thumbnail cache key (#1489069)
- Fix exit code on bootsrap errors in CLI mode (#1489044)
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
--- /dev/null
+++ b/program/resources/blank.pdf
Binary files differ