Browse Source

Gracefully fail if the URL filename cannot be decoded.

gigaherz 13 years ago
parent
commit
d64bb603c8
  1. 5
      web/viewer.js

5
web/viewer.js

@ -385,7 +385,12 @@ var PDFView = {
setTitleUsingUrl: function pdfViewSetTitleUsingUrl(url) { setTitleUsingUrl: function pdfViewSetTitleUsingUrl(url) {
this.url = url; this.url = url;
try {
document.title = decodeURIComponent(getFileName(url)) || url; document.title = decodeURIComponent(getFileName(url)) || url;
} catch (Exception) {
console.log('WARNING: Unable to decode: ' + getFileName(url));
document.title = url;
}
}, },
open: function pdfViewOpen(url, scale, password) { open: function pdfViewOpen(url, scale, password) {

Loading…
Cancel
Save