From b4ceb4078df0e3998cdaa8f674014f6d4142f640 Mon Sep 17 00:00:00 2001 From: El RIDO Date: Sat, 15 Jun 2019 09:47:55 +0200 Subject: [PATCH] removed obsolete code and comments, tested with a PDF of 9 MiB and it works fine in Firefox and Chrome --- js/privatebin.js | 11 ----------- tpl/bootstrap.php | 2 +- tpl/page.php | 2 +- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/js/privatebin.js b/js/privatebin.js index 461b62c6..f43441c4 100644 --- a/js/privatebin.js +++ b/js/privatebin.js @@ -2793,17 +2793,6 @@ jQuery.PrivateBin = (function($, RawDeflate) { .attr('src', blobUrl)) ); } else if (mimeType.match(/\/pdf/i)) { - // PDFs are only displayed if the filesize is smaller than about 1MB (after base64 encoding). - // Bigger filesizes currently cause crashes in various browsers. - // See also: https://code.google.com/p/chromium/issues/detail?id=69227 - - // Firefox crashes with files that are about 1.5MB - // The performance with 1MB files is bearable - /*if (data.length > 1398488) { - Alert.showError('File too large, to display a preview. Please download the attachment.'); //TODO: is this error really necessary? - return; - }*/ - // Fallback for browsers, that don't support the vh unit var clientHeight = $(window).height(); diff --git a/tpl/bootstrap.php b/tpl/bootstrap.php index 48001f12..541c61f1 100644 --- a/tpl/bootstrap.php +++ b/tpl/bootstrap.php @@ -72,7 +72,7 @@ if ($MARKDOWN): endif; ?> - + diff --git a/tpl/page.php b/tpl/page.php index 512df89a..129f38e6 100644 --- a/tpl/page.php +++ b/tpl/page.php @@ -50,7 +50,7 @@ if ($MARKDOWN): endif; ?> - +