Prevent PhantomJS error loop

This commit is contained in:
Hillel Coren 2017-05-24 20:40:43 +03:00
parent f2d59f098f
commit f82eecf2fb

View File

@ -117,8 +117,9 @@
try { try {
return getPDFString(refreshPDFCB, force); return getPDFString(refreshPDFCB, force);
} catch (exception) { } catch (exception) {
if (location.href.indexOf('/view/')) { var href = location.href;
var url = location.href.replace('/view/', '/download/') + '?base64=true'; if (href.indexOf('/view/') && href.indexOf('phantomjs') == -1) {
var url = href.replace('/view/', '/download/') + '?base64=true';
$.get(url, function(result) { $.get(url, function(result) {
refreshPDFCB(result); refreshPDFCB(result);
}) })