Merge pull request #2031 from gigaherz/url-decode-2
Gracefully fail if the URL filename cannot be decoded.
This commit is contained in:
commit
d9e2367c75
@ -385,7 +385,13 @@ var PDFView = {
|
|||||||
|
|
||||||
setTitleUsingUrl: function pdfViewSetTitleUsingUrl(url) {
|
setTitleUsingUrl: function pdfViewSetTitleUsingUrl(url) {
|
||||||
this.url = url;
|
this.url = url;
|
||||||
document.title = decodeURIComponent(getFileName(url)) || url;
|
try {
|
||||||
|
document.title = decodeURIComponent(getFileName(url)) || url;
|
||||||
|
} catch (e) {
|
||||||
|
// decodeURIComponent may throw URIError,
|
||||||
|
// fall back to using the unprocessed url in that case
|
||||||
|
document.title = url;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
open: function pdfViewOpen(url, scale, password) {
|
open: function pdfViewOpen(url, scale, password) {
|
||||||
|
Loading…
Reference in New Issue
Block a user